tmpfs /var tmpfs defaults 0 0
tmpfs /tmp tmpfs defaults 0 0
tmpfs /dev/shm tmpfs mode=0777 0 0
-#/dev/sda1 /media/hdd auto defaults 0 0
+/dev/sda1 /media/hdd auto defaults 0 0
PRIORITY = "required"
PR = "r91"
PR_dm7025 = "r92"
-PR_vusolo = "r92"
+PR_vusolo = "r93"
LICENSE = "GPL"
FSTAB_dm7025 = "${@base_contains('PREFERRED_VERSION_linux-dm7025', '2.6.12.6', 'fstab_old', 'fstab', d)}"
+for mod in isofs cifs usb-storage sr_mod vfat cdrom ntfs; do
+ modprobe $mod
+done
for mod in input evdev i2c-core firmware_class; do
modprobe $mod
depmod -Ae
echo 12 > /proc/progress
-for mod in isofs cifs usb-storage sr_mod vfat cdrom ntfs; do
- modprobe $mod
-done
for mod in nls_base nls_cp437 nls_iso8859-1 nls_utf8; do
modprobe $mod
echo 13 > /proc/progress
+#Solo has only usb port. Needs a delay for usb pvr
+sleep 5
mount -at nonfs,nosmbfs,noncpfs,nocifs
echo 14 > /proc/progress
DEPENDS = "makedevs"
RDEPENDS = "makedevs"
LICENSE = "GPL"
-PR = "r24"
+PR = "r25"
#FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/${P}', '${FILE_DIRNAME}/initscripts-${PV}', '${FILE_DIRNAME}/files', '${FILE_DIRNAME}' ], d)}"
#deprecated
+++ /dev/null
-Index: drivers/media/dvb/dvb-core/dvb_ca_en50221.h
-===================================================================
---- drivers/media/dvb/dvb-core/dvb_ca_en50221.h (revision 1)
-+++ drivers/media/dvb/dvb-core/dvb_ca_en50221.h (working copy)
-@@ -45,8 +45,10 @@
- /* the module owning this structure */
- struct module* owner;
-
-- /* NOTE: the read_*, write_* and poll_slot_status functions must use locks as
-- * they may be called from several threads at once */
-+ /* NOTE: the read_*, write_* and poll_slot_status functions will be
-+ * called for different slots concurrently and need to use locks where
-+ * and if appropriate. There will be no concurrent access to one slot.
-+ */
-
- /* functions for accessing attribute memory on the CAM */
- int (*read_attribute_mem)(struct dvb_ca_en50221* ca, int slot, int address);
-Index: drivers/media/dvb/dvb-core/dvbdev.h
-===================================================================
---- drivers/media/dvb/dvb-core/dvbdev.h (revision 1)
-+++ drivers/media/dvb/dvb-core/dvbdev.h (working copy)
-@@ -27,10 +27,17 @@
- #include <linux/poll.h>
- #include <linux/fs.h>
- #include <linux/list.h>
--#include <linux/smp_lock.h>
-
- #define DVB_MAJOR 212
-
-+#if defined(CONFIG_DVB_MAX_ADAPTERS) && CONFIG_DVB_MAX_ADAPTERS > 0
-+ #define DVB_MAX_ADAPTERS CONFIG_DVB_MAX_ADAPTERS
-+#else
-+ #define DVB_MAX_ADAPTERS 8
-+#endif
-+
-+#define DVB_UNSET (-1)
-+
- #define DVB_DEVICE_VIDEO 0
- #define DVB_DEVICE_AUDIO 1
- #define DVB_DEVICE_SEC 2
-@@ -41,7 +48,14 @@
- #define DVB_DEVICE_NET 7
- #define DVB_DEVICE_OSD 8
-
-+#define DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr) \
-+ static short adapter_nr[] = \
-+ {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET }; \
-+ module_param_array(adapter_nr, short, NULL, 0444); \
-+ MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers")
-
-+struct dvb_frontend;
-+
- struct dvb_adapter {
- int num;
- struct list_head list_head;
-@@ -53,14 +67,45 @@
- struct device *device;
-
- struct module *module;
-+
-+ int mfe_shared; /* indicates mutually exclusive frontends */
-+ struct dvb_device *mfe_dvbdev; /* frontend device in use */
-+ struct mutex mfe_lock; /* access lock for thread creation */
-+
-+ /* Allow the adapter/bridge driver to perform an action before and/or
-+ * after the core handles an ioctl:
-+ *
-+ * DVB_FE_IOCTL_PRE indicates that the ioctl has not yet been handled.
-+ * DVB_FE_IOCTL_POST indicates that the ioctl has been handled.
-+ *
-+ * When DVB_FE_IOCTL_PRE is passed to the callback as the stage arg:
-+ *
-+ * return 0 to allow dvb-core to handle the ioctl.
-+ * return a positive int to prevent dvb-core from handling the ioctl,
-+ * and exit without error.
-+ * return a negative int to prevent dvb-core from handling the ioctl,
-+ * and return that value as an error.
-+ *
-+ * When DVB_FE_IOCTL_POST is passed to the callback as the stage arg:
-+ *
-+ * return 0 to allow the dvb_frontend ioctl handler to exit normally.
-+ * return a negative int to cause the dvb_frontend ioctl handler to
-+ * return that value as an error.
-+ */
-+#define DVB_FE_IOCTL_PRE 0
-+#define DVB_FE_IOCTL_POST 1
-+ int (*fe_ioctl_override)(struct dvb_frontend *fe,
-+ unsigned int cmd, void *parg,
-+ unsigned int stage);
- };
-
-
- struct dvb_device {
- struct list_head list_head;
-- struct file_operations *fops;
-+ const struct file_operations *fops;
- struct dvb_adapter *adapter;
- int type;
-+ int minor;
- u32 id;
-
- /* in theory, 'users' can vanish now,
-@@ -69,6 +114,7 @@
- int writers;
- int users;
-
-+ wait_queue_head_t wait_queue;
- /* don't really need those !? -- FIXME: use video_usercopy */
- int (*kernel_ioctl)(struct inode *inode, struct file *file,
- unsigned int cmd, void *arg);
-@@ -77,7 +123,9 @@
- };
-
-
--extern int dvb_register_adapter (struct dvb_adapter *adap, const char *name, struct module *module, struct device *device);
-+extern int dvb_register_adapter(struct dvb_adapter *adap, const char *name,
-+ struct module *module, struct device *device,
-+ short *adapter_nums);
- extern int dvb_unregister_adapter (struct dvb_adapter *adap);
-
- extern int dvb_register_device (struct dvb_adapter *adap,
-@@ -102,4 +150,26 @@
- int (*func)(struct inode *inode, struct file *file,
- unsigned int cmd, void *arg));
-
-+/** generic DVB attach function. */
-+#ifdef CONFIG_MEDIA_ATTACH
-+#define dvb_attach(FUNCTION, ARGS...) ({ \
-+ void *__r = NULL; \
-+ typeof(&FUNCTION) __a = symbol_request(FUNCTION); \
-+ if (__a) { \
-+ __r = (void *) __a(ARGS); \
-+ if (__r == NULL) \
-+ symbol_put(FUNCTION); \
-+ } else { \
-+ printk(KERN_ERR "DVB: Unable to find symbol "#FUNCTION"()\n"); \
-+ } \
-+ __r; \
-+})
-+
-+#else
-+#define dvb_attach(FUNCTION, ARGS...) ({ \
-+ FUNCTION(ARGS); \
-+})
-+
-+#endif
-+
- #endif /* #ifndef _DVBDEV_H_ */
-Index: drivers/media/dvb/dvb-core/dvb_frontend.h
-===================================================================
---- drivers/media/dvb/dvb-core/dvb_frontend.h (revision 1)
-+++ drivers/media/dvb/dvb-core/dvb_frontend.h (working copy)
-@@ -35,6 +35,8 @@
- #include <linux/module.h>
- #include <linux/errno.h>
- #include <linux/delay.h>
-+#include <linux/mutex.h>
-+#include <linux/slab.h>
-
- #include <linux/dvb/frontend.h>
-
-@@ -61,6 +63,132 @@
- u32 bandwidth_step;
- };
-
-+struct analog_parameters {
-+ unsigned int frequency;
-+ unsigned int mode;
-+ unsigned int audmode;
-+ u64 std;
-+};
-+
-+enum dvbfe_modcod {
-+ DVBFE_MODCOD_DUMMY_PLFRAME = 0,
-+ DVBFE_MODCOD_QPSK_1_4,
-+ DVBFE_MODCOD_QPSK_1_3,
-+ DVBFE_MODCOD_QPSK_2_5,
-+ DVBFE_MODCOD_QPSK_1_2,
-+ DVBFE_MODCOD_QPSK_3_5,
-+ DVBFE_MODCOD_QPSK_2_3,
-+ DVBFE_MODCOD_QPSK_3_4,
-+ DVBFE_MODCOD_QPSK_4_5,
-+ DVBFE_MODCOD_QPSK_5_6,
-+ DVBFE_MODCOD_QPSK_8_9,
-+ DVBFE_MODCOD_QPSK_9_10,
-+ DVBFE_MODCOD_8PSK_3_5,
-+ DVBFE_MODCOD_8PSK_2_3,
-+ DVBFE_MODCOD_8PSK_3_4,
-+ DVBFE_MODCOD_8PSK_5_6,
-+ DVBFE_MODCOD_8PSK_8_9,
-+ DVBFE_MODCOD_8PSK_9_10,
-+ DVBFE_MODCOD_16APSK_2_3,
-+ DVBFE_MODCOD_16APSK_3_4,
-+ DVBFE_MODCOD_16APSK_4_5,
-+ DVBFE_MODCOD_16APSK_5_6,
-+ DVBFE_MODCOD_16APSK_8_9,
-+ DVBFE_MODCOD_16APSK_9_10,
-+ DVBFE_MODCOD_32APSK_3_4,
-+ DVBFE_MODCOD_32APSK_4_5,
-+ DVBFE_MODCOD_32APSK_5_6,
-+ DVBFE_MODCOD_32APSK_8_9,
-+ DVBFE_MODCOD_32APSK_9_10,
-+ DVBFE_MODCOD_RESERVED_1,
-+ DVBFE_MODCOD_BPSK_1_3,
-+ DVBFE_MODCOD_BPSK_1_4,
-+ DVBFE_MODCOD_RESERVED_2
-+};
-+
-+enum tuner_param {
-+ DVBFE_TUNER_FREQUENCY = (1 << 0),
-+ DVBFE_TUNER_TUNERSTEP = (1 << 1),
-+ DVBFE_TUNER_IFFREQ = (1 << 2),
-+ DVBFE_TUNER_BANDWIDTH = (1 << 3),
-+ DVBFE_TUNER_REFCLOCK = (1 << 4),
-+ DVBFE_TUNER_IQSENSE = (1 << 5),
-+ DVBFE_TUNER_DUMMY = (1 << 31)
-+};
-+
-+/*
-+ * ALGO_HW: (Hardware Algorithm)
-+ * ----------------------------------------------------------------
-+ * Devices that support this algorithm do everything in hardware
-+ * and no software support is needed to handle them.
-+ * Requesting these devices to LOCK is the only thing required,
-+ * device is supposed to do everything in the hardware.
-+ *
-+ * ALGO_SW: (Software Algorithm)
-+ * ----------------------------------------------------------------
-+ * These are dumb devices, that require software to do everything
-+ *
-+ * ALGO_CUSTOM: (Customizable Agorithm)
-+ * ----------------------------------------------------------------
-+ * Devices having this algorithm can be customized to have specific
-+ * algorithms in the frontend driver, rather than simply doing a
-+ * software zig-zag. In this case the zigzag maybe hardware assisted
-+ * or it maybe completely done in hardware. In all cases, usage of
-+ * this algorithm, in conjunction with the search and track
-+ * callbacks, utilizes the driver specific algorithm.
-+ *
-+ * ALGO_RECOVERY: (Recovery Algorithm)
-+ * ----------------------------------------------------------------
-+ * These devices have AUTO recovery capabilities from LOCK failure
-+ */
-+enum dvbfe_algo {
-+ DVBFE_ALGO_HW = (1 << 0),
-+ DVBFE_ALGO_SW = (1 << 1),
-+ DVBFE_ALGO_CUSTOM = (1 << 2),
-+ DVBFE_ALGO_RECOVERY = (1 << 31)
-+};
-+
-+struct tuner_state {
-+ u32 frequency;
-+ u32 tunerstep;
-+ u32 ifreq;
-+ u32 bandwidth;
-+ u32 iqsense;
-+ u32 refclock;
-+};
-+
-+/*
-+ * search callback possible return status
-+ *
-+ * DVBFE_ALGO_SEARCH_SUCCESS
-+ * The frontend search algorithm completed and returned successfully
-+ *
-+ * DVBFE_ALGO_SEARCH_ASLEEP
-+ * The frontend search algorithm is sleeping
-+ *
-+ * DVBFE_ALGO_SEARCH_FAILED
-+ * The frontend search for a signal failed
-+ *
-+ * DVBFE_ALGO_SEARCH_INVALID
-+ * The frontend search algorith was probably supplied with invalid
-+ * parameters and the search is an invalid one
-+ *
-+ * DVBFE_ALGO_SEARCH_ERROR
-+ * The frontend search algorithm failed due to some error
-+ *
-+ * DVBFE_ALGO_SEARCH_AGAIN
-+ * The frontend search algorithm was requested to search again
-+ */
-+enum dvbfe_search {
-+ DVBFE_ALGO_SEARCH_SUCCESS = (1 << 0),
-+ DVBFE_ALGO_SEARCH_ASLEEP = (1 << 1),
-+ DVBFE_ALGO_SEARCH_FAILED = (1 << 2),
-+ DVBFE_ALGO_SEARCH_INVALID = (1 << 3),
-+ DVBFE_ALGO_SEARCH_AGAIN = (1 << 4),
-+ DVBFE_ALGO_SEARCH_ERROR = (1 << 31),
-+};
-+
-+
- struct dvb_tuner_ops {
-
- struct dvb_tuner_info info;
-@@ -71,39 +199,77 @@
-
- /** This is for simple PLLs - set all parameters in one go. */
- int (*set_params)(struct dvb_frontend *fe, struct dvb_frontend_parameters *p);
-+ int (*set_analog_params)(struct dvb_frontend *fe, struct analog_parameters *p);
-
- /** This is support for demods like the mt352 - fills out the supplied buffer with what to write. */
- int (*calc_regs)(struct dvb_frontend *fe, struct dvb_frontend_parameters *p, u8 *buf, int buf_len);
-
-+ /** This is to allow setting tuner-specific configs */
-+ int (*set_config)(struct dvb_frontend *fe, void *priv_cfg);
-+
- int (*get_frequency)(struct dvb_frontend *fe, u32 *frequency);
- int (*get_bandwidth)(struct dvb_frontend *fe, u32 *bandwidth);
-
- #define TUNER_STATUS_LOCKED 1
-+#define TUNER_STATUS_STEREO 2
- int (*get_status)(struct dvb_frontend *fe, u32 *status);
-+ int (*get_rf_strength)(struct dvb_frontend *fe, u16 *strength);
-
-- /** These are provided seperately from set_params in order to facilitate silicon
-- * tuners which require sophisticated tuning loops, controlling each parameter seperately. */
-+ /** These are provided separately from set_params in order to facilitate silicon
-+ * tuners which require sophisticated tuning loops, controlling each parameter separately. */
- int (*set_frequency)(struct dvb_frontend *fe, u32 frequency);
- int (*set_bandwidth)(struct dvb_frontend *fe, u32 bandwidth);
-+
-+ /*
-+ * These are provided separately from set_params in order to facilitate silicon
-+ * tuners which require sophisticated tuning loops, controlling each parameter separately.
-+ */
-+ int (*set_state)(struct dvb_frontend *fe, enum tuner_param param, struct tuner_state *state);
-+ int (*get_state)(struct dvb_frontend *fe, enum tuner_param param, struct tuner_state *state);
- };
-
-+struct analog_demod_info {
-+ char *name;
-+};
-+
-+struct analog_demod_ops {
-+
-+ struct analog_demod_info info;
-+
-+ void (*set_params)(struct dvb_frontend *fe,
-+ struct analog_parameters *params);
-+ int (*has_signal)(struct dvb_frontend *fe);
-+ int (*is_stereo)(struct dvb_frontend *fe);
-+ int (*get_afc)(struct dvb_frontend *fe);
-+ void (*tuner_status)(struct dvb_frontend *fe);
-+ void (*standby)(struct dvb_frontend *fe);
-+ void (*release)(struct dvb_frontend *fe);
-+ int (*i2c_gate_ctrl)(struct dvb_frontend *fe, int enable);
-+
-+ /** This is to allow setting tuner-specific configuration */
-+ int (*set_config)(struct dvb_frontend *fe, void *priv_cfg);
-+};
-+
- struct dvb_frontend_ops {
-
- struct dvb_frontend_info info;
-
- void (*release)(struct dvb_frontend* fe);
-+ void (*release_sec)(struct dvb_frontend* fe);
-
- int (*init)(struct dvb_frontend* fe);
- int (*sleep)(struct dvb_frontend* fe);
-
-+ int (*write)(struct dvb_frontend* fe, u8* buf, int len);
-+
- /* if this is set, it overrides the default swzigzag */
- int (*tune)(struct dvb_frontend* fe,
- struct dvb_frontend_parameters* params,
- unsigned int mode_flags,
-- int *delay,
-+ unsigned int *delay,
- fe_status_t *status);
- /* get frontend tuning algorithm from the module */
-- int (*get_frontend_algo)(struct dvb_frontend *fe);
-+ enum dvbfe_algo (*get_frontend_algo)(struct dvb_frontend *fe);
-
- /* these two are only used for the swzigzag code */
- int (*set_frontend)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
-@@ -126,8 +292,21 @@
- 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 (*ts_bus_ctrl)(struct dvb_frontend* fe, int acquire);
-
-+ /* These callbacks are for devices that implement their own
-+ * tuning algorithms, rather than a simple swzigzag
-+ */
-+ enum dvbfe_search (*search)(struct dvb_frontend *fe, struct dvb_frontend_parameters *p);
-+ int (*track)(struct dvb_frontend *fe, struct dvb_frontend_parameters *p);
-+
- struct dvb_tuner_ops tuner_ops;
-+ struct analog_demod_ops analog_ops;
-+
-+ int (*set_property)(struct dvb_frontend* fe, struct dtv_property* tvp);
-+ int (*get_property)(struct dvb_frontend* fe, struct dtv_property* tvp);
-+
-+ int (*set_sw_loopthrough)(struct dvb_frontend* fe, int* arg);
- };
-
- #define MAX_EVENT 8
-@@ -138,23 +317,73 @@
- int eventr;
- int overflow;
- wait_queue_head_t wait_queue;
-- struct semaphore sem;
-+ struct mutex mtx;
- };
-
-+struct dtv_frontend_properties {
-+
-+ /* Cache State */
-+ u32 state;
-+
-+ u32 frequency;
-+ fe_modulation_t modulation;
-+
-+ fe_sec_voltage_t voltage;
-+ fe_sec_tone_mode_t sectone;
-+ fe_spectral_inversion_t inversion;
-+ fe_code_rate_t fec_inner;
-+ fe_transmit_mode_t transmission_mode;
-+ u32 bandwidth_hz; /* 0 = AUTO */
-+ fe_guard_interval_t guard_interval;
-+ fe_hierarchy_t hierarchy;
-+ u32 symbol_rate;
-+ fe_code_rate_t code_rate_HP;
-+ fe_code_rate_t code_rate_LP;
-+
-+ fe_pilot_t pilot;
-+ fe_rolloff_t rolloff;
-+
-+ fe_delivery_system_t delivery_system;
-+
-+ /* ISDB-T specifics */
-+ u8 isdbt_partial_reception;
-+ u8 isdbt_sb_mode;
-+ u8 isdbt_sb_subchannel;
-+ u32 isdbt_sb_segment_idx;
-+ u32 isdbt_sb_segment_count;
-+ u8 isdbt_layer_enabled;
-+ struct {
-+ u8 segment_count;
-+ fe_code_rate_t fec;
-+ fe_modulation_t modulation;
-+ u8 interleaving;
-+ } layer[3];
-+
-+ /* ISDB-T specifics */
-+ u32 isdbs_ts_id;
-+};
-+
- struct dvb_frontend {
- struct dvb_frontend_ops ops;
- struct dvb_adapter *dvb;
-- void* demodulator_priv;
-- void* tuner_priv;
-- void* frontend_priv;
-- void* misc_priv;
-+ void *demodulator_priv;
-+ void *tuner_priv;
-+ void *frontend_priv;
-+ void *sec_priv;
-+ void *analog_demod_priv;
-+ struct dtv_frontend_properties dtv_property_cache;
-+#define DVB_FRONTEND_COMPONENT_TUNER 0
-+ int (*callback)(void *adapter_priv, int component, int cmd, int arg);
-+ int id;
- };
-
--extern int dvb_register_frontend(struct dvb_adapter* dvb,
-- struct dvb_frontend* fe);
-+extern int dvb_register_frontend(struct dvb_adapter *dvb,
-+ struct dvb_frontend *fe);
-
--extern int dvb_unregister_frontend(struct dvb_frontend* fe);
-+extern int dvb_unregister_frontend(struct dvb_frontend *fe);
-
-+extern void dvb_frontend_detach(struct dvb_frontend *fe);
-+
- extern void dvb_frontend_reinitialise(struct dvb_frontend *fe);
-
- extern void dvb_frontend_sleep_until(struct timeval *waketime, u32 add_usec);
-Index: drivers/media/dvb/dvb-core/dvb_demux.h
-===================================================================
---- drivers/media/dvb/dvb-core/dvb_demux.h (revision 1)
-+++ drivers/media/dvb/dvb-core/dvb_demux.h (working copy)
-@@ -26,6 +26,7 @@
- #include <linux/time.h>
- #include <linux/timer.h>
- #include <linux/spinlock.h>
-+#include "compat.h"
- #include <linux/mutex.h>
-
- #include "demux.h"
-@@ -42,6 +43,10 @@
-
- #define DVB_DEMUX_MASK_MAX 18
-
-+#define MAX_PID 0x1fff
-+
-+#define SPEED_PKTS_INTERVAL 50000
-+
- struct dvb_demux_filter {
- struct dmx_section_filter filter;
- u8 maskandmode[DMX_MAX_FILTER_SIZE];
-@@ -56,6 +61,11 @@
-
- u16 hw_handle;
- struct timer_list timer;
-+////////////////////////////////////////////////////
-+ void *priv;
-+ void *buf;
-+ int is_recpump;
-+ struct dvb_demux_filter *pre;
- };
-
- #define DMX_FEED_ENTRY(pos) list_entry(pos, struct dvb_demux_feed, list_head)
-@@ -127,6 +137,11 @@
-
- struct mutex mutex;
- spinlock_t lock;
-+
-+ uint8_t *cnt_storage; /* for TS continuity check */
-+
-+ struct timespec speed_last_time; /* for TS speed check */
-+ uint32_t speed_pkts_cnt; /* for TS speed check */
- };
-
- int dvb_dmx_init(struct dvb_demux *dvbdemux);
-Index: drivers/media/dvb/dvb-core/dvb_net.h
-===================================================================
---- drivers/media/dvb/dvb-core/dvb_net.h (revision 1)
-+++ drivers/media/dvb/dvb-core/dvb_net.h (working copy)
-@@ -36,6 +36,7 @@
- struct dvb_device *dvbdev;
- struct net_device *device[DVB_NET_DEVICES_MAX];
- int state[DVB_NET_DEVICES_MAX];
-+ unsigned int exit:1;
- struct dmx_demux *demux;
- };
-
-Index: drivers/media/dvb/dvb-core/demux.h
-===================================================================
---- drivers/media/dvb/dvb-core/demux.h (revision 1)
-+++ drivers/media/dvb/dvb-core/demux.h (working copy)
-@@ -80,6 +80,8 @@
- #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 */
-
- /* PES type for filters which write to built-in decoder */
- /* these should be kept identical to the types in dmx.h */
-@@ -245,7 +247,7 @@
- void* priv; /* Pointer to private data of the API client */
- int (*open) (struct dmx_demux* demux);
- int (*close) (struct dmx_demux* demux);
-- int (*write) (struct dmx_demux* demux, const char* buf, size_t count);
-+ int (*write) (struct dmx_demux* demux, const char __user *buf, size_t count);
- int (*allocate_ts_feed) (struct dmx_demux* demux,
- struct dmx_ts_feed** feed,
- dmx_ts_cb callback);
-Index: drivers/media/dvb/dvb-core/dvb_ringbuffer.h
-===================================================================
---- drivers/media/dvb/dvb-core/dvb_ringbuffer.h (revision 1)
-+++ drivers/media/dvb/dvb-core/dvb_ringbuffer.h (working copy)
-@@ -38,6 +38,7 @@
- int error;
-
- wait_queue_head_t queue;
-+ int do_wait;
- spinlock_t lock;
- };
-
-@@ -61,7 +62,7 @@
- ** *** read min. 1000, max. <bufsize> bytes ***
- ** avail = dvb_ringbuffer_avail(rbuf);
- ** if (avail >= 1000)
--** count = dvb_ringbuffer_read(rbuf, buffer, min(avail, bufsize), 0);
-+** count = dvb_ringbuffer_read(rbuf, buffer, min(avail, bufsize));
- ** else
- ** ...
- **
-@@ -69,6 +70,7 @@
- ** to lock read or write operations.
- ** Two or more readers must be locked against each other.
- ** Flushing the buffer counts as a read operation.
-+** Resetting the buffer counts as a read and write operation.
- ** Two or more writers must be locked against each other.
- */
-
-@@ -85,6 +87,13 @@
- extern ssize_t dvb_ringbuffer_avail(struct dvb_ringbuffer *rbuf);
-
-
-+/*
-+** Reset the read and write pointers to zero and flush the buffer
-+** This counts as a read and write operation
-+*/
-+extern void dvb_ringbuffer_reset(struct dvb_ringbuffer *rbuf);
-+
-+
- /* read routines & macros */
- /* ---------------------- */
- /* flush buffer */
-@@ -106,8 +115,10 @@
- ** <usermem> specifies whether <buf> resides in user space
- ** returns number of bytes transferred or -EFAULT
- */
--extern ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf,
-- size_t len, int usermem);
-+extern ssize_t dvb_ringbuffer_read_user(struct dvb_ringbuffer *rbuf,
-+ u8 __user *buf, size_t len);
-+extern void dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf,
-+ u8 *buf, size_t len);
-
-
- /* write routines & macros */
-@@ -149,8 +160,10 @@
- * <usermem> Set to 1 if <buf> is in userspace.
- * returns Number of bytes read, or -EFAULT.
- */
-+extern ssize_t dvb_ringbuffer_pkt_read_user(struct dvb_ringbuffer *rbuf, size_t idx,
-+ int offset, u8 __user *buf, size_t len);
- extern ssize_t dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx,
-- int offset, u8* buf, size_t len, int usermem);
-+ int offset, u8 *buf, size_t len);
-
- /**
- * Dispose of a packet in the ring buffer.
-Index: drivers/media/dvb/dvb-core/dmxdev.h
-===================================================================
---- drivers/media/dvb/dvb-core/dmxdev.h (revision 1)
-+++ drivers/media/dvb/dvb-core/dmxdev.h (working copy)
-@@ -30,7 +30,9 @@
- #include <linux/wait.h>
- #include <linux/fs.h>
- #include <linux/string.h>
-+#include "compat.h"
- #include <linux/mutex.h>
-+#include <linux/slab.h>
-
- #include <linux/dvb/dmx.h>
-
-@@ -53,13 +55,20 @@
- DMXDEV_STATE_TIMEDOUT
- };
-
-+struct dmxdev_feed {
-+ u16 pid;
-+ struct dmx_ts_feed *ts;
-+ struct list_head next;
-+};
-+
- struct dmxdev_filter {
- union {
- struct dmx_section_filter *sec;
- } filter;
-
- union {
-- struct dmx_ts_feed *ts;
-+ /* list of TS and PES feeds (struct dmxdev_feed) */
-+ struct list_head ts;
- struct dmx_section_feed *sec;
- } feed;
-
-@@ -91,6 +100,8 @@
-
- int filternum;
- int capabilities;
-+
-+ unsigned int exit:1;
- #define DMXDEV_CAP_DUPLEX 1
- struct dmx_frontend *dvr_orig_fe;
-
--- /dev/null
+Index: drivers/media/dvb/dvb-core/dvb_ca_en50221.h
+===================================================================
+--- drivers/media/dvb/dvb-core/dvb_ca_en50221.h (revision 1)
++++ drivers/media/dvb/dvb-core/dvb_ca_en50221.h (working copy)
+@@ -45,8 +45,10 @@
+ /* the module owning this structure */
+ struct module* owner;
+
+- /* NOTE: the read_*, write_* and poll_slot_status functions must use locks as
+- * they may be called from several threads at once */
++ /* NOTE: the read_*, write_* and poll_slot_status functions will be
++ * called for different slots concurrently and need to use locks where
++ * and if appropriate. There will be no concurrent access to one slot.
++ */
+
+ /* functions for accessing attribute memory on the CAM */
+ int (*read_attribute_mem)(struct dvb_ca_en50221* ca, int slot, int address);
+Index: drivers/media/dvb/dvb-core/dvbdev.h
+===================================================================
+--- drivers/media/dvb/dvb-core/dvbdev.h (revision 1)
++++ drivers/media/dvb/dvb-core/dvbdev.h (working copy)
+@@ -27,10 +27,17 @@
+ #include <linux/poll.h>
+ #include <linux/fs.h>
+ #include <linux/list.h>
+-#include <linux/smp_lock.h>
+
+ #define DVB_MAJOR 212
+
++#if defined(CONFIG_DVB_MAX_ADAPTERS) && CONFIG_DVB_MAX_ADAPTERS > 0
++ #define DVB_MAX_ADAPTERS CONFIG_DVB_MAX_ADAPTERS
++#else
++ #define DVB_MAX_ADAPTERS 8
++#endif
++
++#define DVB_UNSET (-1)
++
+ #define DVB_DEVICE_VIDEO 0
+ #define DVB_DEVICE_AUDIO 1
+ #define DVB_DEVICE_SEC 2
+@@ -41,7 +48,14 @@
+ #define DVB_DEVICE_NET 7
+ #define DVB_DEVICE_OSD 8
+
++#define DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr) \
++ static short adapter_nr[] = \
++ {[0 ... (DVB_MAX_ADAPTERS - 1)] = DVB_UNSET }; \
++ module_param_array(adapter_nr, short, NULL, 0444); \
++ MODULE_PARM_DESC(adapter_nr, "DVB adapter numbers")
+
++struct dvb_frontend;
++
+ struct dvb_adapter {
+ int num;
+ struct list_head list_head;
+@@ -53,14 +67,45 @@
+ struct device *device;
+
+ struct module *module;
++
++ int mfe_shared; /* indicates mutually exclusive frontends */
++ struct dvb_device *mfe_dvbdev; /* frontend device in use */
++ struct mutex mfe_lock; /* access lock for thread creation */
++
++ /* Allow the adapter/bridge driver to perform an action before and/or
++ * after the core handles an ioctl:
++ *
++ * DVB_FE_IOCTL_PRE indicates that the ioctl has not yet been handled.
++ * DVB_FE_IOCTL_POST indicates that the ioctl has been handled.
++ *
++ * When DVB_FE_IOCTL_PRE is passed to the callback as the stage arg:
++ *
++ * return 0 to allow dvb-core to handle the ioctl.
++ * return a positive int to prevent dvb-core from handling the ioctl,
++ * and exit without error.
++ * return a negative int to prevent dvb-core from handling the ioctl,
++ * and return that value as an error.
++ *
++ * When DVB_FE_IOCTL_POST is passed to the callback as the stage arg:
++ *
++ * return 0 to allow the dvb_frontend ioctl handler to exit normally.
++ * return a negative int to cause the dvb_frontend ioctl handler to
++ * return that value as an error.
++ */
++#define DVB_FE_IOCTL_PRE 0
++#define DVB_FE_IOCTL_POST 1
++ int (*fe_ioctl_override)(struct dvb_frontend *fe,
++ unsigned int cmd, void *parg,
++ unsigned int stage);
+ };
+
+
+ struct dvb_device {
+ struct list_head list_head;
+- struct file_operations *fops;
++ const struct file_operations *fops;
+ struct dvb_adapter *adapter;
+ int type;
++ int minor;
+ u32 id;
+
+ /* in theory, 'users' can vanish now,
+@@ -69,6 +114,7 @@
+ int writers;
+ int users;
+
++ wait_queue_head_t wait_queue;
+ /* don't really need those !? -- FIXME: use video_usercopy */
+ int (*kernel_ioctl)(struct inode *inode, struct file *file,
+ unsigned int cmd, void *arg);
+@@ -77,7 +123,9 @@
+ };
+
+
+-extern int dvb_register_adapter (struct dvb_adapter *adap, const char *name, struct module *module, struct device *device);
++extern int dvb_register_adapter(struct dvb_adapter *adap, const char *name,
++ struct module *module, struct device *device,
++ short *adapter_nums);
+ extern int dvb_unregister_adapter (struct dvb_adapter *adap);
+
+ extern int dvb_register_device (struct dvb_adapter *adap,
+@@ -102,4 +150,26 @@
+ int (*func)(struct inode *inode, struct file *file,
+ unsigned int cmd, void *arg));
+
++/** generic DVB attach function. */
++#ifdef CONFIG_MEDIA_ATTACH
++#define dvb_attach(FUNCTION, ARGS...) ({ \
++ void *__r = NULL; \
++ typeof(&FUNCTION) __a = symbol_request(FUNCTION); \
++ if (__a) { \
++ __r = (void *) __a(ARGS); \
++ if (__r == NULL) \
++ symbol_put(FUNCTION); \
++ } else { \
++ printk(KERN_ERR "DVB: Unable to find symbol "#FUNCTION"()\n"); \
++ } \
++ __r; \
++})
++
++#else
++#define dvb_attach(FUNCTION, ARGS...) ({ \
++ FUNCTION(ARGS); \
++})
++
++#endif
++
+ #endif /* #ifndef _DVBDEV_H_ */
+Index: drivers/media/dvb/dvb-core/dvb_frontend.h
+===================================================================
+--- drivers/media/dvb/dvb-core/dvb_frontend.h (revision 1)
++++ drivers/media/dvb/dvb-core/dvb_frontend.h (working copy)
+@@ -35,6 +35,8 @@
+ #include <linux/module.h>
+ #include <linux/errno.h>
+ #include <linux/delay.h>
++#include <linux/mutex.h>
++#include <linux/slab.h>
+
+ #include <linux/dvb/frontend.h>
+
+@@ -61,6 +63,132 @@
+ u32 bandwidth_step;
+ };
+
++struct analog_parameters {
++ unsigned int frequency;
++ unsigned int mode;
++ unsigned int audmode;
++ u64 std;
++};
++
++enum dvbfe_modcod {
++ DVBFE_MODCOD_DUMMY_PLFRAME = 0,
++ DVBFE_MODCOD_QPSK_1_4,
++ DVBFE_MODCOD_QPSK_1_3,
++ DVBFE_MODCOD_QPSK_2_5,
++ DVBFE_MODCOD_QPSK_1_2,
++ DVBFE_MODCOD_QPSK_3_5,
++ DVBFE_MODCOD_QPSK_2_3,
++ DVBFE_MODCOD_QPSK_3_4,
++ DVBFE_MODCOD_QPSK_4_5,
++ DVBFE_MODCOD_QPSK_5_6,
++ DVBFE_MODCOD_QPSK_8_9,
++ DVBFE_MODCOD_QPSK_9_10,
++ DVBFE_MODCOD_8PSK_3_5,
++ DVBFE_MODCOD_8PSK_2_3,
++ DVBFE_MODCOD_8PSK_3_4,
++ DVBFE_MODCOD_8PSK_5_6,
++ DVBFE_MODCOD_8PSK_8_9,
++ DVBFE_MODCOD_8PSK_9_10,
++ DVBFE_MODCOD_16APSK_2_3,
++ DVBFE_MODCOD_16APSK_3_4,
++ DVBFE_MODCOD_16APSK_4_5,
++ DVBFE_MODCOD_16APSK_5_6,
++ DVBFE_MODCOD_16APSK_8_9,
++ DVBFE_MODCOD_16APSK_9_10,
++ DVBFE_MODCOD_32APSK_3_4,
++ DVBFE_MODCOD_32APSK_4_5,
++ DVBFE_MODCOD_32APSK_5_6,
++ DVBFE_MODCOD_32APSK_8_9,
++ DVBFE_MODCOD_32APSK_9_10,
++ DVBFE_MODCOD_RESERVED_1,
++ DVBFE_MODCOD_BPSK_1_3,
++ DVBFE_MODCOD_BPSK_1_4,
++ DVBFE_MODCOD_RESERVED_2
++};
++
++enum tuner_param {
++ DVBFE_TUNER_FREQUENCY = (1 << 0),
++ DVBFE_TUNER_TUNERSTEP = (1 << 1),
++ DVBFE_TUNER_IFFREQ = (1 << 2),
++ DVBFE_TUNER_BANDWIDTH = (1 << 3),
++ DVBFE_TUNER_REFCLOCK = (1 << 4),
++ DVBFE_TUNER_IQSENSE = (1 << 5),
++ DVBFE_TUNER_DUMMY = (1 << 31)
++};
++
++/*
++ * ALGO_HW: (Hardware Algorithm)
++ * ----------------------------------------------------------------
++ * Devices that support this algorithm do everything in hardware
++ * and no software support is needed to handle them.
++ * Requesting these devices to LOCK is the only thing required,
++ * device is supposed to do everything in the hardware.
++ *
++ * ALGO_SW: (Software Algorithm)
++ * ----------------------------------------------------------------
++ * These are dumb devices, that require software to do everything
++ *
++ * ALGO_CUSTOM: (Customizable Agorithm)
++ * ----------------------------------------------------------------
++ * Devices having this algorithm can be customized to have specific
++ * algorithms in the frontend driver, rather than simply doing a
++ * software zig-zag. In this case the zigzag maybe hardware assisted
++ * or it maybe completely done in hardware. In all cases, usage of
++ * this algorithm, in conjunction with the search and track
++ * callbacks, utilizes the driver specific algorithm.
++ *
++ * ALGO_RECOVERY: (Recovery Algorithm)
++ * ----------------------------------------------------------------
++ * These devices have AUTO recovery capabilities from LOCK failure
++ */
++enum dvbfe_algo {
++ DVBFE_ALGO_HW = (1 << 0),
++ DVBFE_ALGO_SW = (1 << 1),
++ DVBFE_ALGO_CUSTOM = (1 << 2),
++ DVBFE_ALGO_RECOVERY = (1 << 31)
++};
++
++struct tuner_state {
++ u32 frequency;
++ u32 tunerstep;
++ u32 ifreq;
++ u32 bandwidth;
++ u32 iqsense;
++ u32 refclock;
++};
++
++/*
++ * search callback possible return status
++ *
++ * DVBFE_ALGO_SEARCH_SUCCESS
++ * The frontend search algorithm completed and returned successfully
++ *
++ * DVBFE_ALGO_SEARCH_ASLEEP
++ * The frontend search algorithm is sleeping
++ *
++ * DVBFE_ALGO_SEARCH_FAILED
++ * The frontend search for a signal failed
++ *
++ * DVBFE_ALGO_SEARCH_INVALID
++ * The frontend search algorith was probably supplied with invalid
++ * parameters and the search is an invalid one
++ *
++ * DVBFE_ALGO_SEARCH_ERROR
++ * The frontend search algorithm failed due to some error
++ *
++ * DVBFE_ALGO_SEARCH_AGAIN
++ * The frontend search algorithm was requested to search again
++ */
++enum dvbfe_search {
++ DVBFE_ALGO_SEARCH_SUCCESS = (1 << 0),
++ DVBFE_ALGO_SEARCH_ASLEEP = (1 << 1),
++ DVBFE_ALGO_SEARCH_FAILED = (1 << 2),
++ DVBFE_ALGO_SEARCH_INVALID = (1 << 3),
++ DVBFE_ALGO_SEARCH_AGAIN = (1 << 4),
++ DVBFE_ALGO_SEARCH_ERROR = (1 << 31),
++};
++
++
+ struct dvb_tuner_ops {
+
+ struct dvb_tuner_info info;
+@@ -71,39 +199,77 @@
+
+ /** This is for simple PLLs - set all parameters in one go. */
+ int (*set_params)(struct dvb_frontend *fe, struct dvb_frontend_parameters *p);
++ int (*set_analog_params)(struct dvb_frontend *fe, struct analog_parameters *p);
+
+ /** This is support for demods like the mt352 - fills out the supplied buffer with what to write. */
+ int (*calc_regs)(struct dvb_frontend *fe, struct dvb_frontend_parameters *p, u8 *buf, int buf_len);
+
++ /** This is to allow setting tuner-specific configs */
++ int (*set_config)(struct dvb_frontend *fe, void *priv_cfg);
++
+ int (*get_frequency)(struct dvb_frontend *fe, u32 *frequency);
+ int (*get_bandwidth)(struct dvb_frontend *fe, u32 *bandwidth);
+
+ #define TUNER_STATUS_LOCKED 1
++#define TUNER_STATUS_STEREO 2
+ int (*get_status)(struct dvb_frontend *fe, u32 *status);
++ int (*get_rf_strength)(struct dvb_frontend *fe, u16 *strength);
+
+- /** These are provided seperately from set_params in order to facilitate silicon
+- * tuners which require sophisticated tuning loops, controlling each parameter seperately. */
++ /** These are provided separately from set_params in order to facilitate silicon
++ * tuners which require sophisticated tuning loops, controlling each parameter separately. */
+ int (*set_frequency)(struct dvb_frontend *fe, u32 frequency);
+ int (*set_bandwidth)(struct dvb_frontend *fe, u32 bandwidth);
++
++ /*
++ * These are provided separately from set_params in order to facilitate silicon
++ * tuners which require sophisticated tuning loops, controlling each parameter separately.
++ */
++ int (*set_state)(struct dvb_frontend *fe, enum tuner_param param, struct tuner_state *state);
++ int (*get_state)(struct dvb_frontend *fe, enum tuner_param param, struct tuner_state *state);
+ };
+
++struct analog_demod_info {
++ char *name;
++};
++
++struct analog_demod_ops {
++
++ struct analog_demod_info info;
++
++ void (*set_params)(struct dvb_frontend *fe,
++ struct analog_parameters *params);
++ int (*has_signal)(struct dvb_frontend *fe);
++ int (*is_stereo)(struct dvb_frontend *fe);
++ int (*get_afc)(struct dvb_frontend *fe);
++ void (*tuner_status)(struct dvb_frontend *fe);
++ void (*standby)(struct dvb_frontend *fe);
++ void (*release)(struct dvb_frontend *fe);
++ int (*i2c_gate_ctrl)(struct dvb_frontend *fe, int enable);
++
++ /** This is to allow setting tuner-specific configuration */
++ int (*set_config)(struct dvb_frontend *fe, void *priv_cfg);
++};
++
+ struct dvb_frontend_ops {
+
+ struct dvb_frontend_info info;
+
+ void (*release)(struct dvb_frontend* fe);
++ void (*release_sec)(struct dvb_frontend* fe);
+
+ int (*init)(struct dvb_frontend* fe);
+ int (*sleep)(struct dvb_frontend* fe);
+
++ int (*write)(struct dvb_frontend* fe, u8* buf, int len);
++
+ /* if this is set, it overrides the default swzigzag */
+ int (*tune)(struct dvb_frontend* fe,
+ struct dvb_frontend_parameters* params,
+ unsigned int mode_flags,
+- int *delay,
++ unsigned int *delay,
+ fe_status_t *status);
+ /* get frontend tuning algorithm from the module */
+- int (*get_frontend_algo)(struct dvb_frontend *fe);
++ enum dvbfe_algo (*get_frontend_algo)(struct dvb_frontend *fe);
+
+ /* these two are only used for the swzigzag code */
+ int (*set_frontend)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
+@@ -126,8 +292,20 @@
+ 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 (*ts_bus_ctrl)(struct dvb_frontend* fe, int acquire);
+
++ /* These callbacks are for devices that implement their own
++ * tuning algorithms, rather than a simple swzigzag
++ */
++ enum dvbfe_search (*search)(struct dvb_frontend *fe, struct dvb_frontend_parameters *p);
++ int (*track)(struct dvb_frontend *fe, struct dvb_frontend_parameters *p);
++
+ struct dvb_tuner_ops tuner_ops;
++ struct analog_demod_ops analog_ops;
++
++ int (*set_property)(struct dvb_frontend* fe, struct dtv_property* tvp);
++ int (*get_property)(struct dvb_frontend* fe, struct dtv_property* tvp);
++
+ };
+
+ #define MAX_EVENT 8
+@@ -138,23 +316,73 @@
+ int eventr;
+ int overflow;
+ wait_queue_head_t wait_queue;
+- struct semaphore sem;
++ struct mutex mtx;
+ };
+
++struct dtv_frontend_properties {
++
++ /* Cache State */
++ u32 state;
++
++ u32 frequency;
++ fe_modulation_t modulation;
++
++ fe_sec_voltage_t voltage;
++ fe_sec_tone_mode_t sectone;
++ fe_spectral_inversion_t inversion;
++ fe_code_rate_t fec_inner;
++ fe_transmit_mode_t transmission_mode;
++ u32 bandwidth_hz; /* 0 = AUTO */
++ fe_guard_interval_t guard_interval;
++ fe_hierarchy_t hierarchy;
++ u32 symbol_rate;
++ fe_code_rate_t code_rate_HP;
++ fe_code_rate_t code_rate_LP;
++
++ fe_pilot_t pilot;
++ fe_rolloff_t rolloff;
++
++ fe_delivery_system_t delivery_system;
++
++ /* ISDB-T specifics */
++ u8 isdbt_partial_reception;
++ u8 isdbt_sb_mode;
++ u8 isdbt_sb_subchannel;
++ u32 isdbt_sb_segment_idx;
++ u32 isdbt_sb_segment_count;
++ u8 isdbt_layer_enabled;
++ struct {
++ u8 segment_count;
++ fe_code_rate_t fec;
++ fe_modulation_t modulation;
++ u8 interleaving;
++ } layer[3];
++
++ /* ISDB-T specifics */
++ u32 isdbs_ts_id;
++};
++
+ struct dvb_frontend {
+ struct dvb_frontend_ops ops;
+ struct dvb_adapter *dvb;
+- void* demodulator_priv;
+- void* tuner_priv;
+- void* frontend_priv;
+- void* misc_priv;
++ void *demodulator_priv;
++ void *tuner_priv;
++ void *frontend_priv;
++ void *sec_priv;
++ void *analog_demod_priv;
++ struct dtv_frontend_properties dtv_property_cache;
++#define DVB_FRONTEND_COMPONENT_TUNER 0
++ int (*callback)(void *adapter_priv, int component, int cmd, int arg);
++ int id;
+ };
+
+-extern int dvb_register_frontend(struct dvb_adapter* dvb,
+- struct dvb_frontend* fe);
++extern int dvb_register_frontend(struct dvb_adapter *dvb,
++ struct dvb_frontend *fe);
+
+-extern int dvb_unregister_frontend(struct dvb_frontend* fe);
++extern int dvb_unregister_frontend(struct dvb_frontend *fe);
+
++extern void dvb_frontend_detach(struct dvb_frontend *fe);
++
+ extern void dvb_frontend_reinitialise(struct dvb_frontend *fe);
+
+ extern void dvb_frontend_sleep_until(struct timeval *waketime, u32 add_usec);
+Index: drivers/media/dvb/dvb-core/dvb_demux.h
+===================================================================
+--- drivers/media/dvb/dvb-core/dvb_demux.h (revision 1)
++++ drivers/media/dvb/dvb-core/dvb_demux.h (working copy)
+@@ -26,6 +26,7 @@
+ #include <linux/time.h>
+ #include <linux/timer.h>
+ #include <linux/spinlock.h>
++#include "compat.h"
+ #include <linux/mutex.h>
+
+ #include "demux.h"
+@@ -42,6 +43,10 @@
+
+ #define DVB_DEMUX_MASK_MAX 18
+
++#define MAX_PID 0x1fff
++
++#define SPEED_PKTS_INTERVAL 50000
++
+ struct dvb_demux_filter {
+ struct dmx_section_filter filter;
+ u8 maskandmode[DMX_MAX_FILTER_SIZE];
+@@ -127,6 +132,11 @@
+
+ struct mutex mutex;
+ spinlock_t lock;
++
++ uint8_t *cnt_storage; /* for TS continuity check */
++
++ struct timespec speed_last_time; /* for TS speed check */
++ uint32_t speed_pkts_cnt; /* for TS speed check */
+ };
+
+ int dvb_dmx_init(struct dvb_demux *dvbdemux);
+Index: drivers/media/dvb/dvb-core/dvb_net.h
+===================================================================
+--- drivers/media/dvb/dvb-core/dvb_net.h (revision 1)
++++ drivers/media/dvb/dvb-core/dvb_net.h (working copy)
+@@ -36,6 +36,7 @@
+ struct dvb_device *dvbdev;
+ struct net_device *device[DVB_NET_DEVICES_MAX];
+ int state[DVB_NET_DEVICES_MAX];
++ unsigned int exit:1;
+ struct dmx_demux *demux;
+ };
+
+Index: drivers/media/dvb/dvb-core/demux.h
+===================================================================
+--- drivers/media/dvb/dvb-core/demux.h (revision 1)
++++ drivers/media/dvb/dvb-core/demux.h (working copy)
+@@ -80,6 +80,8 @@
+ #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 */
+
+ /* PES type for filters which write to built-in decoder */
+ /* these should be kept identical to the types in dmx.h */
+@@ -245,7 +247,7 @@
+ void* priv; /* Pointer to private data of the API client */
+ int (*open) (struct dmx_demux* demux);
+ int (*close) (struct dmx_demux* demux);
+- int (*write) (struct dmx_demux* demux, const char* buf, size_t count);
++ int (*write) (struct dmx_demux* demux, const char __user *buf, size_t count);
+ int (*allocate_ts_feed) (struct dmx_demux* demux,
+ struct dmx_ts_feed** feed,
+ dmx_ts_cb callback);
+Index: drivers/media/dvb/dvb-core/dvb_ringbuffer.h
+===================================================================
+--- drivers/media/dvb/dvb-core/dvb_ringbuffer.h (revision 1)
++++ drivers/media/dvb/dvb-core/dvb_ringbuffer.h (working copy)
+@@ -38,6 +38,7 @@
+ int error;
+
+ wait_queue_head_t queue;
++ int do_wait;
+ spinlock_t lock;
+ };
+
+@@ -61,7 +62,7 @@
+ ** *** read min. 1000, max. <bufsize> bytes ***
+ ** avail = dvb_ringbuffer_avail(rbuf);
+ ** if (avail >= 1000)
+-** count = dvb_ringbuffer_read(rbuf, buffer, min(avail, bufsize), 0);
++** count = dvb_ringbuffer_read(rbuf, buffer, min(avail, bufsize));
+ ** else
+ ** ...
+ **
+@@ -69,6 +70,7 @@
+ ** to lock read or write operations.
+ ** Two or more readers must be locked against each other.
+ ** Flushing the buffer counts as a read operation.
++** Resetting the buffer counts as a read and write operation.
+ ** Two or more writers must be locked against each other.
+ */
+
+@@ -85,6 +87,13 @@
+ extern ssize_t dvb_ringbuffer_avail(struct dvb_ringbuffer *rbuf);
+
+
++/*
++** Reset the read and write pointers to zero and flush the buffer
++** This counts as a read and write operation
++*/
++extern void dvb_ringbuffer_reset(struct dvb_ringbuffer *rbuf);
++
++
+ /* read routines & macros */
+ /* ---------------------- */
+ /* flush buffer */
+@@ -106,8 +115,10 @@
+ ** <usermem> specifies whether <buf> resides in user space
+ ** returns number of bytes transferred or -EFAULT
+ */
+-extern ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf,
+- size_t len, int usermem);
++extern ssize_t dvb_ringbuffer_read_user(struct dvb_ringbuffer *rbuf,
++ u8 __user *buf, size_t len);
++extern void dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf,
++ u8 *buf, size_t len);
+
+
+ /* write routines & macros */
+@@ -149,8 +160,10 @@
+ * <usermem> Set to 1 if <buf> is in userspace.
+ * returns Number of bytes read, or -EFAULT.
+ */
++extern ssize_t dvb_ringbuffer_pkt_read_user(struct dvb_ringbuffer *rbuf, size_t idx,
++ int offset, u8 __user *buf, size_t len);
+ extern ssize_t dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx,
+- int offset, u8* buf, size_t len, int usermem);
++ int offset, u8 *buf, size_t len);
+
+ /**
+ * Dispose of a packet in the ring buffer.
+Index: drivers/media/dvb/dvb-core/dmxdev.h
+===================================================================
+--- drivers/media/dvb/dvb-core/dmxdev.h (revision 1)
++++ drivers/media/dvb/dvb-core/dmxdev.h (working copy)
+@@ -30,7 +30,9 @@
+ #include <linux/wait.h>
+ #include <linux/fs.h>
+ #include <linux/string.h>
++#include "compat.h"
+ #include <linux/mutex.h>
++#include <linux/slab.h>
+
+ #include <linux/dvb/dmx.h>
+
+@@ -53,13 +55,20 @@
+ DMXDEV_STATE_TIMEDOUT
+ };
+
++struct dmxdev_feed {
++ u16 pid;
++ struct dmx_ts_feed *ts;
++ struct list_head next;
++};
++
+ struct dmxdev_filter {
+ union {
+ struct dmx_section_filter *sec;
+ } filter;
+
+ union {
+- struct dmx_ts_feed *ts;
++ /* list of TS and PES feeds (struct dmxdev_feed) */
++ struct list_head ts;
+ struct dmx_section_feed *sec;
+ } feed;
+
+@@ -91,6 +100,8 @@
+
+ int filternum;
+ int capabilities;
++
++ unsigned int exit:1;
+ #define DMXDEV_CAP_DUPLEX 1
+ struct dmx_frontend *dvr_orig_fe;
+
LICENSE = "GPL"
KV = "2.6.18-7.3"
PV = "2.6.18"
-PR = "r8"
+PR = "r9"
MODULE = "stblinux-2.6.18"
file://linux-vusolo_kojbect.patch;patch=1;pnum=0 \
file://linux-vusolo_romblock.patch;patch=1;pnum=0 \
file://linux-2.6.18-dvb-frontends.patch;patch=1;pnum=0 \
- file://linux-2.6.18-dvb-core.patch;patch=1;pnum=0 \
+ file://linux-2.6.18-dvb-core2.patch;patch=1;pnum=0 \
file://dvb-include-2.6.18-5.3.patch;patch=1;pnum=0 \
file://linux-vusolo_serial.patch;patch=1;pnum=0"
PV_vusolo = "${KV}"
-SRCDATE_bm750 = "20101203"
-SRCDATE_vusolo = "20101203"
+SRCDATE_bm750 = "20101221"
+SRCDATE_vusolo = "20101221"
RDEPENDS = "initscripts-vuplus kernel (${KV}) kernel-module-firmware-class kernel-module-input kernel-module-evdev kernel-module-i2c-core kernel-module-snd kernel-module-snd-pcm"