summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/dvb')
-rw-r--r--linux/drivers/media/dvb/dvb-core/compat.h2
-rw-r--r--linux/drivers/media/dvb/dvb-core/demux.h36
-rw-r--r--linux/drivers/media/dvb/dvb-core/dmxdev.c37
-rw-r--r--linux/drivers/media/dvb/dvb-core/dmxdev.h26
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_demux.c27
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_demux.h2
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_filter.c52
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_filter.h91
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_frontend.c2
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_i2c.c1
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_ksyms.c12
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_net.c5
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c7
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.h3
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvbdev.c25
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvbdev.h4
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110_ipack.c5
-rw-r--r--linux/drivers/media/dvb/ttpci/budget-av.c1
-rw-r--r--linux/drivers/media/dvb/ttpci/budget.c1
-rw-r--r--linux/drivers/media/dvb/ttpci/budget.h4
20 files changed, 180 insertions, 163 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/compat.h b/linux/drivers/media/dvb/dvb-core/compat.h
index 292d6c958..37207413b 100644
--- a/linux/drivers/media/dvb/dvb-core/compat.h
+++ b/linux/drivers/media/dvb/dvb-core/compat.h
@@ -1,8 +1,8 @@
#ifndef __CRAP_H
#define __CRAP_H
-#include <asm/string.h>
#include <asm/uaccess.h>
+#include <linux/string.h>
#include <linux/smp_lock.h>
#include <linux/version.h>
#include <linux/fs.h>
diff --git a/linux/drivers/media/dvb/dvb-core/demux.h b/linux/drivers/media/dvb/dvb-core/demux.h
index d1dfa8b5e..71ba6c624 100644
--- a/linux/drivers/media/dvb/dvb-core/demux.h
+++ b/linux/drivers/media/dvb/dvb-core/demux.h
@@ -25,14 +25,10 @@
#ifndef __DEMUX_H
#define __DEMUX_H
-#ifndef __KERNEL__
-#define __KERNEL__
-#endif
-
-#include <linux/types.h>
+#include <asm/types.h>
+#include <asm/errno.h>
#include <linux/list.h>
#include <linux/time.h>
-#include <linux/errno.h>
/*--------------------------------------------------------------------------*/
/* Common definitions */
@@ -115,7 +111,7 @@ struct dmx_ts_feed_s {
struct dmx_demux_s *parent; /* Back-pointer */
void *priv; /* Pointer to private data of the API client */
int (*set) (struct dmx_ts_feed_s *feed,
- uint16_t pid,
+ u16 pid,
int type,
dmx_ts_pes_t pes_type,
size_t callback_length,
@@ -133,9 +129,9 @@ typedef struct dmx_ts_feed_s dmx_ts_feed_t;
/*--------------------------------------------------------------------------*/
typedef struct {
- __u8 filter_value [DMX_MAX_FILTER_SIZE];
- __u8 filter_mask [DMX_MAX_FILTER_SIZE];
- __u8 filter_mode [DMX_MAX_FILTER_SIZE];
+ u8 filter_value [DMX_MAX_FILTER_SIZE];
+ u8 filter_mask [DMX_MAX_FILTER_SIZE];
+ u8 filter_mode [DMX_MAX_FILTER_SIZE];
struct dmx_section_feed_s* parent; /* Back-pointer */
void* priv; /* Pointer to private data of the API client */
} dmx_section_filter_t;
@@ -153,7 +149,7 @@ struct dmx_section_feed_s {
int seclen;
int (*set) (struct dmx_section_feed_s* feed,
- __u16 pid,
+ u16 pid,
size_t circular_buffer_size,
int descramble,
int check_crc);
@@ -247,7 +243,7 @@ struct dmx_demux_s {
char* id; /* Unique demux identifier */
char* vendor; /* Name of the demux vendor */
char* model; /* Name of the demux model */
- __u32 capabilities; /* Bitfield of capability flags */
+ u32 capabilities; /* Bitfield of capability flags */
dmx_frontend_t* frontend; /* Front-end connected to the demux */
struct list_head reg_list; /* List of registered demuxes */
void* priv; /* Pointer to private data of the API client */
@@ -266,16 +262,16 @@ struct dmx_demux_s {
int (*release_section_feed) (struct dmx_demux_s* demux,
dmx_section_feed_t* feed);
int (*descramble_mac_address) (struct dmx_demux_s* demux,
- __u8* buffer1,
+ u8* buffer1,
size_t buffer1_length,
- __u8* buffer2,
+ u8* buffer2,
size_t buffer2_length,
- __u16 pid);
+ u16 pid);
int (*descramble_section_payload) (struct dmx_demux_s* demux,
- __u8* buffer1,
+ u8* buffer1,
size_t buffer1_length,
- __u8* buffer2, size_t buffer2_length,
- __u16 pid);
+ u8* buffer2, size_t buffer2_length,
+ u16 pid);
int (*add_frontend) (struct dmx_demux_s* demux,
dmx_frontend_t* frontend);
int (*remove_frontend) (struct dmx_demux_s* demux,
@@ -285,10 +281,10 @@ struct dmx_demux_s {
dmx_frontend_t* frontend);
int (*disconnect_frontend) (struct dmx_demux_s* demux);
- int (*get_pes_pids) (struct dmx_demux_s* demux, __u16 *pids);
+ int (*get_pes_pids) (struct dmx_demux_s* demux, u16 *pids);
int (*get_stc) (struct dmx_demux_s* demux, unsigned int num,
- uint64_t *stc, unsigned int *base);
+ u64 *stc, unsigned int *base);
};
typedef struct dmx_demux_s dmx_demux_t;
diff --git a/linux/drivers/media/dvb/dvb-core/dmxdev.c b/linux/drivers/media/dvb/dvb-core/dmxdev.c
index 56fd12ca4..5433e23f9 100644
--- a/linux/drivers/media/dvb/dvb-core/dmxdev.c
+++ b/linux/drivers/media/dvb/dvb-core/dmxdev.c
@@ -21,10 +21,15 @@
*
*/
-#include <linux/vmalloc.h>
+#include <asm/uaccess.h>
+#include <asm/system.h>
+#include <linux/spinlock.h>
+#include <linux/slab.h>
#include <linux/module.h>
+#include <linux/sched.h>
#include <linux/poll.h>
-#include <asm/uaccess.h>
+#include <linux/ioctl.h>
+#include <linux/wait.h>
#include "dmxdev.h"
#include "compat.h"
@@ -203,7 +208,7 @@ static int dvb_dvr_open(struct inode *inode, struct file *file)
if ((file->f_flags&O_ACCMODE)==O_RDONLY) {
dvb_dmxdev_buffer_init(&dmxdev->dvr_buffer);
dmxdev->dvr_buffer.size=DVR_BUFFER_SIZE;
- dmxdev->dvr_buffer.data=vmalloc(DVR_BUFFER_SIZE);
+ dmxdev->dvr_buffer.data=kmalloc(DVR_BUFFER_SIZE, GFP_KERNEL);
if (!dmxdev->dvr_buffer.data) {
up(&dmxdev->mutex);
return -ENOMEM;
@@ -251,7 +256,7 @@ static int dvb_dvr_release(struct inode *inode, struct file *file)
spin_lock_irq(&dmxdev->lock);
dmxdev->dvr_buffer.data=0;
spin_unlock_irq(&dmxdev->lock);
- vfree(mem);
+ kfree(mem);
}
}
up(&dmxdev->mutex);
@@ -316,10 +321,10 @@ dvb_dmxdev_set_buffer_size(dmxdev_filter_t *dmxdevfilter, unsigned long size)
buf->pwrite=buf->pread=0;
spin_unlock_irq(&dmxdevfilter->dev->lock);
if (mem)
- vfree(mem);
+ kfree(mem);
if (buf->size) {
- mem=vmalloc(dmxdevfilter->buffer.size);
+ mem=kmalloc(dmxdevfilter->buffer.size, GFP_KERNEL);
if (!mem)
return -ENOMEM;
spin_lock_irq(&dmxdevfilter->dev->lock);
@@ -481,7 +486,7 @@ int dvb_dmxdev_feed_restart(dmxdev_filter_t *filter)
{
int i;
dmxdev_t *dmxdev = filter->dev;
- uint16_t pid = filter->params.sec.pid;
+ u16 pid = filter->params.sec.pid;
for (i=0; i<dmxdev->filternum; i++)
if (dmxdev->filter[i].state>=DMXDEV_STATE_GO &&
@@ -558,7 +563,7 @@ dvb_dmxdev_filter_start(dmxdev_filter_t *filter)
dvb_dmxdev_filter_stop(filter);
if (!(mem = filter->buffer.data)) {
- mem = vmalloc(filter->buffer.size);
+ mem = kmalloc(filter->buffer.size, GFP_KERNEL);
spin_lock_irq(&filter->dev->lock);
filter->buffer.data=mem;
spin_unlock_irq(&filter->dev->lock);
@@ -762,7 +767,7 @@ int dvb_dmxdev_filter_free(dmxdev_t *dmxdev, dmxdev_filter_t *dmxdevfilter)
spin_lock_irq(&dmxdev->lock);
dmxdevfilter->buffer.data=0;
spin_unlock_irq(&dmxdev->lock);
- vfree(mem);
+ kfree(mem);
}
dvb_dmxdev_filter_state_set(dmxdevfilter, DMXDEV_STATE_FREE);
@@ -957,7 +962,7 @@ static int dvb_demux_do_ioctl(struct inode *inode, struct file *file,
ret=-EINVAL;
break;
}
- dmxdev->demux->get_pes_pids(dmxdev->demux, (uint16_t *)parg);
+ dmxdev->demux->get_pes_pids(dmxdev->demux, (u16 *)parg);
break;
case DMX_GET_STC:
@@ -1116,13 +1121,15 @@ dvb_dmxdev_init(dmxdev_t *dmxdev, struct dvb_adapter *dvb_adapter)
if (dmxdev->demux->open(dmxdev->demux)<0)
return -EUSERS;
- dmxdev->filter=vmalloc(dmxdev->filternum*sizeof(dmxdev_filter_t));
+ dmxdev->filter=kmalloc(dmxdev->filternum*sizeof(dmxdev_filter_t),
+ GFP_KERNEL);
+
if (!dmxdev->filter)
return -ENOMEM;
- dmxdev->dvr=vmalloc(dmxdev->filternum*sizeof(dmxdev_dvr_t));
+ dmxdev->dvr=kmalloc(dmxdev->filternum*sizeof(dmxdev_dvr_t), GFP_KERNEL);
if (!dmxdev->dvr) {
- vfree(dmxdev->filter);
+ kfree(dmxdev->filter);
dmxdev->filter=0;
return -ENOMEM;
}
@@ -1152,11 +1159,11 @@ dvb_dmxdev_release(dmxdev_t *dmxdev)
dvb_unregister_device(dmxdev->dvbdev);
dvb_unregister_device(dmxdev->dvr_dvbdev);
if (dmxdev->filter) {
- vfree(dmxdev->filter);
+ kfree(dmxdev->filter);
dmxdev->filter=0;
}
if (dmxdev->dvr) {
- vfree(dmxdev->dvr);
+ kfree(dmxdev->dvr);
dmxdev->dvr=0;
}
dmxdev->demux->close(dmxdev->demux);
diff --git a/linux/drivers/media/dvb/dvb-core/dmxdev.h b/linux/drivers/media/dvb/dvb-core/dmxdev.h
index e56aafc2f..cdae2990e 100644
--- a/linux/drivers/media/dvb/dvb-core/dmxdev.h
+++ b/linux/drivers/media/dvb/dvb-core/dmxdev.h
@@ -24,16 +24,16 @@
#ifndef _DMXDEV_H_
#define _DMXDEV_H_
-#ifndef __KERNEL__
-#define __KERNEL__
-#endif
-
-#include <linux/dvb/dmx.h>
-
-#include <linux/version.h>
+#include <asm/types.h>
+#include <asm/semaphore.h>
+#include <linux/spinlock.h>
+#include <linux/kernel.h>
+#include <linux/timer.h>
#include <linux/wait.h>
-#include <linux/types.h>
#include <linux/fs.h>
+#include <linux/string.h>
+
+#include <linux/dvb/dmx.h>
#include "dvbdev.h"
#include "demux.h"
@@ -54,10 +54,10 @@ typedef enum {
} dmxdev_state_t;
typedef struct dmxdev_buffer_s {
- uint8_t *data;
- uint32_t size;
- int32_t pread;
- int32_t pwrite;
+ u8 *data;
+ int size;
+ int pread;
+ int pwrite;
wait_queue_head_t queue;
int error;
} dmxdev_buffer_t;
@@ -90,7 +90,7 @@ typedef struct dmxdev_filter_s {
// only for sections
struct timer_list timer;
int todo;
- uint8_t secheader[3];
+ u8 secheader[3];
u16 pid;
} dmxdev_filter_t;
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_demux.c b/linux/drivers/media/dvb/dvb-core/dvb_demux.c
index a7e67c8e9..a6eea1dc4 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_demux.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_demux.c
@@ -21,11 +21,12 @@
*
*/
-#include <linux/vmalloc.h>
+#include <asm/uaccess.h>
+#include <linux/spinlock.h>
+#include <linux/slab.h>
#include <linux/module.h>
#include <linux/poll.h>
-#include <linux/version.h>
-#include <asm/uaccess.h>
+#include <linux/string.h>
#include "dvb_demux.h"
#include "compat.h"
@@ -576,7 +577,7 @@ int dmx_ts_feed_set (struct dmx_ts_feed_s* ts_feed, u16 pid, int ts_type,
#ifdef NOBUFS
feed->buffer=0;
#else
- feed->buffer = vmalloc(feed->buffer_size);
+ feed->buffer = kmalloc(feed->buffer_size, GFP_KERNEL);
if (!feed->buffer) {
up(&demux->mutex);
return -ENOMEM;
@@ -719,7 +720,7 @@ int dvbdmx_release_ts_feed(dmx_demux_t *dmx, dmx_ts_feed_t *ts_feed)
#ifndef NOBUFS
if (feed->buffer) {
- vfree(feed->buffer);
+ kfree(feed->buffer);
feed->buffer=0;
}
#endif
@@ -815,7 +816,7 @@ dmx_section_feed_set(struct dmx_section_feed_s* feed,
#ifdef NOBUFS
dvbdmxfeed->buffer=0;
#else
- dvbdmxfeed->buffer=vmalloc(dvbdmxfeed->buffer_size);
+ dvbdmxfeed->buffer=malloc(dvbdmxfeed->buffer_size, GFP_KERNEL);
if (!dvbdmxfeed->buffer) {
up(&dvbdmx->mutex);
return -ENOMEM;
@@ -998,7 +999,7 @@ static int dvbdmx_release_section_feed(dmx_demux_t *demux,
}
#ifndef NOBUFS
if (dvbdmxfeed->buffer) {
- vfree(dvbdmxfeed->buffer);
+ kfree(dvbdmxfeed->buffer);
dvbdmxfeed->buffer=0;
}
#endif
@@ -1149,13 +1150,15 @@ dvb_dmx_init(struct dvb_demux *dvbdemux)
dmx_demux_t *dmx=&dvbdemux->dmx;
dvbdemux->users=0;
- dvbdemux->filter=vmalloc(dvbdemux->filternum*sizeof(struct dvb_demux_filter));
+ dvbdemux->filter=kmalloc(dvbdemux->filternum*sizeof(struct dvb_demux_filter),
+ GFP_KERNEL);
if (!dvbdemux->filter)
return -ENOMEM;
- dvbdemux->feed=vmalloc(dvbdemux->feednum*sizeof(struct dvb_demux_feed));
+ dvbdemux->feed=kmalloc(dvbdemux->feednum*sizeof(struct dvb_demux_feed),
+ GFP_KERNEL);
if (!dvbdemux->feed) {
- vfree(dvbdemux->filter);
+ kfree(dvbdemux->filter);
return -ENOMEM;
}
for (i=0; i<dvbdemux->filternum; i++) {
@@ -1218,9 +1221,9 @@ dvb_dmx_release(struct dvb_demux *dvbdemux)
dmx_unregister_demux(dmx);
if (dvbdemux->filter)
- vfree(dvbdemux->filter);
+ kfree(dvbdemux->filter);
if (dvbdemux->feed)
- vfree(dvbdemux->feed);
+ kfree(dvbdemux->feed);
return 0;
}
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_demux.h b/linux/drivers/media/dvb/dvb-core/dvb_demux.h
index 344a126b9..04e551618 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_demux.h
+++ b/linux/drivers/media/dvb/dvb-core/dvb_demux.h
@@ -26,7 +26,9 @@
#define _DVB_DEMUX_H_
#include <asm/semaphore.h>
+#include <linux/time.h>
#include <linux/timer.h>
+#include <linux/spinlock.h>
#include "demux.h"
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_filter.c b/linux/drivers/media/dvb/dvb-core/dvb_filter.c
index 1b076eb37..44ad8e563 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_filter.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_filter.c
@@ -1,4 +1,6 @@
+#include <linux/kernel.h>
#include <linux/module.h>
+#include <linux/string.h>
#include "dvb_filter.h"
unsigned int bitrates[3][16] =
@@ -6,14 +8,14 @@ unsigned int bitrates[3][16] =
{0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,0},
{0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,0}};
-uint32_t freq[4] = {441, 480, 320, 0};
+u32 freq[4] = {441, 480, 320, 0};
unsigned int ac3_bitrates[32] =
{32,40,48,56,64,80,96,112,128,160,192,224,256,320,384,448,512,576,640,
0,0,0,0,0,0,0,0,0,0,0,0,0};
-uint32_t ac3_freq[4] = {480, 441, 320, 0};
-uint32_t ac3_frames[3][32] =
+u32 ac3_freq[4] = {480, 441, 320, 0};
+u32 ac3_frames[3][32] =
{{64,80,96,112,128,160,192,224,256,320,384,448,512,640,768,896,1024,
1152,1280,0,0,0,0,0,0,0,0,0,0,0,0,0},
{69,87,104,121,139,174,208,243,278,348,417,487,557,696,835,975,1114,
@@ -67,9 +69,9 @@ void ts_to_pes(ipack *p, u8 *buf) // don't need count (=188)
#if 0
/* needs 5 byte input, returns picture coding type*/
static
-int read_picture_header(uint8_t *headr, mpg_picture *pic, int field, int pr)
+int read_picture_header(u8 *headr, mpg_picture *pic, int field, int pr)
{
- uint8_t pct;
+ u8 pct;
if (pr) printk( "Pic header: ");
pic->temporal_reference[field] = (( headr[0] << 2 ) |
@@ -114,7 +116,7 @@ int read_picture_header(uint8_t *headr, mpg_picture *pic, int field, int pr)
#if 0
/* needs 4 byte input */
static
-int read_gop_header(uint8_t *headr, mpg_picture *pic, int pr)
+int read_gop_header(u8 *headr, mpg_picture *pic, int pr)
{
if (pr) printk("GOP header: ");
@@ -146,7 +148,7 @@ int read_gop_header(uint8_t *headr, mpg_picture *pic, int pr)
#if 0
/* needs 8 byte input */
static
-int read_sequence_header(uint8_t *headr, VideoInfo *vi, int pr)
+int read_sequence_header(u8 *headr, VideoInfo *vi, int pr)
{
int sw;
int form = -1;
@@ -261,14 +263,14 @@ int read_sequence_header(uint8_t *headr, VideoInfo *vi, int pr)
#if 0
static
-int get_vinfo(uint8_t *mbuf, int count, VideoInfo *vi, int pr)
+int get_vinfo(u8 *mbuf, int count, VideoInfo *vi, int pr)
{
- uint8_t *headr;
+ u8 *headr;
int found = 0;
int c = 0;
while (found < 4 && c+4 < count){
- uint8_t *b;
+ u8 *b;
b = mbuf+c;
if ( b[0] == 0x00 && b[1] == 0x00 && b[2] == 0x01
@@ -291,15 +293,15 @@ int get_vinfo(uint8_t *mbuf, int count, VideoInfo *vi, int pr)
#if 0
static
-int get_ainfo(uint8_t *mbuf, int count, AudioInfo *ai, int pr)
+int get_ainfo(u8 *mbuf, int count, AudioInfo *ai, int pr)
{
- uint8_t *headr;
+ u8 *headr;
int found = 0;
int c = 0;
int fr = 0;
while (found < 2 && c < count){
- uint8_t b[2];
+ u8 b[2];
memcpy( b, mbuf+c, 2);
if ( b[0] == 0xff && (b[1] & 0xf8) == 0xf8)
@@ -346,16 +348,16 @@ int get_ainfo(uint8_t *mbuf, int count, AudioInfo *ai, int pr)
#endif
-int dvb_filter_get_ac3info(uint8_t *mbuf, int count, AudioInfo *ai, int pr)
+int dvb_filter_get_ac3info(u8 *mbuf, int count, AudioInfo *ai, int pr)
{
- uint8_t *headr;
+ u8 *headr;
int found = 0;
int c = 0;
- uint8_t frame = 0;
+ u8 frame = 0;
int fr = 0;
while ( !found && c < count){
- uint8_t *b = mbuf+c;
+ u8 *b = mbuf+c;
if ( b[0] == 0x0b && b[1] == 0x77 )
found = 1;
@@ -378,18 +380,18 @@ int dvb_filter_get_ac3info(uint8_t *mbuf, int count, AudioInfo *ai, int pr)
ai->bit_rate = ac3_bitrates[frame >> 1]*1000;
if (pr)
- printk(" BRate: %d kb/s", ai->bit_rate/1000);
+ printk(" BRate: %d kb/s", (int) ai->bit_rate/1000);
ai->frequency = (headr[2] & 0xc0 ) >> 6;
fr = (headr[2] & 0xc0 ) >> 6;
ai->frequency = freq[fr]*100;
- if (pr) printk (" Freq: %d Hz\n", ai->frequency);
+ if (pr) printk (" Freq: %d Hz\n", (int) ai->frequency);
ai->framesize = ac3_frames[fr][frame >> 1];
if ((frame & 1) && (fr == 1)) ai->framesize++;
ai->framesize = ai->framesize << 1;
- if (pr) printk (" Framesize %d\n", ai->framesize);
+ if (pr) printk (" Framesize %d\n",(int) ai->framesize);
return 0;
@@ -398,11 +400,11 @@ int dvb_filter_get_ac3info(uint8_t *mbuf, int count, AudioInfo *ai, int pr)
#if 0
static
-uint8_t *skip_pes_header(uint8_t **bufp)
+u8 *skip_pes_header(u8 **bufp)
{
- uint8_t *inbuf = *bufp;
- uint8_t *buf = inbuf;
- uint8_t *pts = NULL;
+ u8 *inbuf = *bufp;
+ u8 *buf = inbuf;
+ u8 *pts = NULL;
int skip = 0;
static const int mpeg1_skip_table[16] = {
@@ -437,7 +439,7 @@ uint8_t *skip_pes_header(uint8_t **bufp)
#if 0
static
-void initialize_quant_matrix( uint32_t *matrix )
+void initialize_quant_matrix( u32 *matrix )
{
int i;
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_filter.h b/linux/drivers/media/dvb/dvb-core/dvb_filter.h
index 082c65601..51974f2f7 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_filter.h
+++ b/linux/drivers/media/dvb/dvb-core/dvb_filter.h
@@ -2,7 +2,6 @@
#define _DVB_FILTER_H_
#include <linux/slab.h>
-#include <linux/vmalloc.h>
#include "demux.h"
@@ -116,7 +115,7 @@ typedef struct ipack_s {
int found;
u8 *buf;
u8 cid;
- uint32_t plength;
+ u32 plength;
u8 plen[2];
u8 flag1;
u8 flag2;
@@ -134,17 +133,17 @@ typedef struct ipack_s {
} ipack;
typedef struct video_i{
- uint32_t horizontal_size;
- uint32_t vertical_size;
- uint32_t aspect_ratio;
- uint32_t framerate;
- uint32_t video_format;
- uint32_t bit_rate;
- uint32_t comp_bit_rate;
- uint32_t vbv_buffer_size;
- int16_t vbv_delay;
- uint32_t CSPF;
- uint32_t off;
+ u32 horizontal_size;
+ u32 vertical_size;
+ u32 aspect_ratio;
+ u32 framerate;
+ u32 video_format;
+ u32 bit_rate;
+ u32 comp_bit_rate;
+ u32 vbv_buffer_size;
+ s16 vbv_delay;
+ u32 CSPF;
+ u32 off;
} VideoInfo;
@@ -156,9 +155,9 @@ typedef struct video_i{
typedef struct mpg_picture_s{
int channel;
VideoInfo vinfo;
- uint32_t *sequence_gop_header;
- uint32_t *picture_header;
- int32_t time_code;
+ u32 *sequence_gop_header;
+ u32 *picture_header;
+ s32 time_code;
int low_delay;
int closed_gop;
int broken_link;
@@ -166,12 +165,12 @@ typedef struct mpg_picture_s{
int gop_flag;
int sequence_end_flag;
- uint8_t profile_and_level;
- int32_t picture_coding_parameter;
- uint32_t matrix[32];
- int8_t matrix_change_flag;
+ u8 profile_and_level;
+ s32 picture_coding_parameter;
+ u32 matrix[32];
+ s8 matrix_change_flag;
- uint8_t picture_header_parameter;
+ u8 picture_header_parameter;
/* bit 0 - 2: bwd f code
bit 3 : fpb vector
bit 4 - 6: fwd f code
@@ -180,11 +179,11 @@ typedef struct mpg_picture_s{
int mpeg1_flag;
int progressive_sequence;
int sequence_display_extension_flag;
- uint32_t sequence_header_data;
- int16_t last_frame_centre_horizontal_offset;
- int16_t last_frame_centre_vertical_offset;
+ u32 sequence_header_data;
+ s16 last_frame_centre_horizontal_offset;
+ s16 last_frame_centre_vertical_offset;
- uint32_t pts[2]; /* [0] 1st field, [1] 2nd field */
+ u32 pts[2]; /* [0] 1st field, [1] 2nd field */
int top_field_first;
int repeat_first_field;
int progressive_frame;
@@ -192,39 +191,39 @@ typedef struct mpg_picture_s{
int forward_bank;
int backward_bank;
int compress;
- int16_t frame_centre_horizontal_offset[OFF_SIZE];
+ s16 frame_centre_horizontal_offset[OFF_SIZE];
/* [0-2] 1st field, [3] 2nd field */
- int16_t frame_centre_vertical_offset[OFF_SIZE];
+ s16 frame_centre_vertical_offset[OFF_SIZE];
/* [0-2] 1st field, [3] 2nd field */
- int16_t temporal_reference[2];
+ s16 temporal_reference[2];
/* [0] 1st field, [1] 2nd field */
- int8_t picture_coding_type[2];
- /* [0] 1st field, [1] 2nd field */
- int8_t picture_structure[2];
- /* [0] 1st field, [1] 2nd field */
- int8_t picture_display_extension_flag[2];
- /* [0] 1st field, [1] 2nd field */
- /* picture_display_extenion() 0:no 1:exit*/
- int8_t pts_flag[2];
- /* [0] 1st field, [1] 2nd field */
+ s8 picture_coding_type[2];
+ /* [0] 1st field, [1] 2nd field */
+ s8 picture_structure[2];
+ /* [0] 1st field, [1] 2nd field */
+ s8 picture_display_extension_flag[2];
+ /* [0] 1st field, [1] 2nd field */
+ /* picture_display_extenion() 0:no 1:exit*/
+ s8 pts_flag[2];
+ /* [0] 1st field, [1] 2nd field */
} mpg_picture;
typedef struct audio_i{
- int layer ;
- uint32_t bit_rate ;
- uint32_t frequency ;
- uint32_t mode ;
- uint32_t mode_extension ;
- uint32_t emphasis ;
- uint32_t framesize;
- uint32_t off;
+ int layer;
+ u32 bit_rate;
+ u32 frequency;
+ u32 mode;
+ u32 mode_extension ;
+ u32 emphasis;
+ u32 framesize;
+ u32 off;
} AudioInfo;
-int dvb_filter_get_ac3info(uint8_t *mbuf, int count, AudioInfo *ai, int pr);
+int dvb_filter_get_ac3info(u8 *mbuf, int count, AudioInfo *ai, int pr);
#endif
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
index 3cdbbe71a..a7aa25c12 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -311,7 +311,7 @@ int dvb_frontend_set_parameters (struct dvb_frontend_data *fe,
dvb_bend_frequency (fe, 0);
dprintk ("%s: f == %i, drift == %i\n",
- __FUNCTION__, param->frequency, fe->lnb_drift);
+ __FUNCTION__, (int) param->frequency, (int) fe->lnb_drift);
param->frequency += fe->lnb_drift + fe->bending;
err = dvb_frontend_internal_ioctl (frontend, FE_SET_FRONTEND, param);
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_i2c.c b/linux/drivers/media/dvb/dvb-core/dvb_i2c.c
index 680e0aa9c..f1bb37aca 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_i2c.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_i2c.c
@@ -24,7 +24,6 @@
#include <linux/slab.h>
#include <linux/list.h>
#include <linux/module.h>
-#include <linux/version.h>
#include "dvb_i2c.h"
#include "compat.h"
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_ksyms.c b/linux/drivers/media/dvb/dvb-core/dvb_ksyms.c
index 60c0ef1b8..a9cf86ba7 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_ksyms.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_ksyms.c
@@ -1,12 +1,16 @@
+#include <asm/uaccess.h>
+#include <asm/errno.h>
#include <linux/module.h>
+#include <linux/ioctl.h>
+#include <linux/slab.h>
+#include <linux/fs.h>
#include "dmxdev.h"
-#include "dvb_filter.h"
-#include "dvb_frontend.h"
-#include "dvb_i2c.h"
-#include "dvbdev.h"
#include "dvb_demux.h"
+#include "dvb_frontend.h"
#include "dvb_net.h"
+#include "dvb_filter.h"
+
/* if the miracle happens and "generic_usercopy()" is included into
the kernel, then this can vanish... */
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_net.c b/linux/drivers/media/dvb/dvb-core/dvb_net.c
index f1059425b..b3d8c44d3 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_net.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_net.c
@@ -24,7 +24,12 @@
*
*/
+#include <asm/errno.h>
#include <asm/uaccess.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/ioctl.h>
+#include <linux/slab.h>
#include <linux/dvb/net.h>
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c b/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c
index 58918a466..8a32231b0 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c
@@ -32,10 +32,12 @@
#define __KERNEL_SYSCALLS__
+#include <asm/uaccess.h>
+#include <asm/errno.h>
#include <linux/kernel.h>
-#include <linux/sched.h>
#include <linux/module.h>
-#include <asm/uaccess.h>
+#include <linux/sched.h>
+#include <linux/string.h>
#include "dvb_ringbuffer.h"
@@ -50,7 +52,6 @@ void dvb_ringbuffer_init(dvb_ringbuffer_t *rbuf, void *data, size_t len)
init_waitqueue_head(&rbuf->queue);
spin_lock_init(&(rbuf->lock));
- rbuf->lock=SPIN_LOCK_UNLOCKED;
}
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.h b/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.h
index 3bbcb2896..f0d8b8caf 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.h
+++ b/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.h
@@ -32,6 +32,9 @@
#ifndef _DVB_RINGBUFFER_H_
#define _DVB_RINGBUFFER_H_
+#include <linux/spinlock.h>
+#include <linux/wait.h>
+
typedef struct dvb_ringbuffer {
u8 *data;
diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.c b/linux/drivers/media/dvb/dvb-core/dvbdev.c
index 267bc1fa4..e625b595d 100644
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c
@@ -21,19 +21,14 @@
*
*/
-#include <linux/config.h>
-#include <linux/version.h>
+#include <asm/types.h>
+#include <asm/errno.h>
+#include <asm/semaphore.h>
+#include <linux/string.h>
#include <linux/module.h>
-#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/sched.h>
-#include <linux/mm.h>
-#include <linux/string.h>
-#include <linux/errno.h>
#include <linux/init.h>
-#include <asm/uaccess.h>
-#include <asm/system.h>
-#include <linux/kmod.h>
#include <linux/slab.h>
#include "dvbdev.h"
@@ -58,13 +53,11 @@ static char *dnames[] = {
#define DVB_MAX_IDS ~0
#define nums2minor(num,type,id) 0
- #define DVB_DEVFS_FLAGS (DEVFS_FL_DEFAULT|DEVFS_FL_AUTO_DEVNUM)
#else
#define DVB_MAX_IDS 4
#define nums2minor(num,type,id) ((num << 6) | (id << 4) | type)
- #define DVB_DEVFS_FLAGS (DEVFS_FL_DEFAULT)
static
struct dvb_device* dvbdev_find_device (int minor)
@@ -198,9 +191,9 @@ skip:
int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
const struct dvb_device *template, void *priv, int type)
{
- u32 id;
- char name [20];
struct dvb_device *dvbdev;
+ char name [20];
+ int id;
if (down_interruptible (&dvbdev_register_lock))
return -ERESTARTSYS;
@@ -229,9 +222,9 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
list_add_tail (&dvbdev->list_head, &adap->device_list);
- sprintf(name, "%s%d", dnames[type], id);
+ snprintf(name, sizeof(name), "%s%d", dnames[type], id);
dvbdev->devfs_handle = devfs_register(adap->devfs_handle, name,
- DVB_DEVFS_FLAGS,
+ DEVFS_FL_DEFAULT,
DVB_MAJOR,
nums2minor(adap->num, type, id),
S_IFCHR | S_IRUSR | S_IWUSR,
@@ -305,7 +298,7 @@ int dvb_register_adapter(struct dvb_adapter **padap, const char *name)
printk ("DVB: registering new adapter (%s).\n", name);
- sprintf(dirname, "adapter%d", num);
+ snprintf(dirname, sizeof(dirname), "adapter%d", num);
adap->devfs_handle = devfs_mk_dir(dvb_devfs_handle, dirname, NULL);
adap->num = num;
adap->name = name;
diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.h b/linux/drivers/media/dvb/dvb-core/dvbdev.h
index d374e4e0e..fcf42e347 100644
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.h
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.h
@@ -24,8 +24,7 @@
#ifndef _DVBDEV_H_
#define _DVBDEV_H_
-#include <linux/types.h>
-#include <linux/version.h>
+#include <asm/types.h>
#include <linux/poll.h>
#include <linux/fs.h>
#include <linux/devfs_fs_kernel.h>
@@ -91,5 +90,6 @@ int dvb_usercopy(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg,
int (*func)(struct inode *inode, struct file *file,
unsigned int cmd, void *arg));
+
#endif /* #ifndef _DVBDEV_H_ */
diff --git a/linux/drivers/media/dvb/ttpci/av7110_ipack.c b/linux/drivers/media/dvb/ttpci/av7110_ipack.c
index 75f0ea8fb..c8a071fb3 100644
--- a/linux/drivers/media/dvb/ttpci/av7110_ipack.c
+++ b/linux/drivers/media/dvb/ttpci/av7110_ipack.c
@@ -22,7 +22,7 @@ void av7110_ipack_reset(ipack *p)
void av7110_ipack_init(ipack *p, int size,
void (*func)(u8 *buf, int size, void *priv))
{
- if ( !(p->buf = vmalloc(size*sizeof(u8))) ){
+ if ( !(p->buf = kmalloc(size*sizeof(u8), GFP_KERNEL)) ){
printk ("Couldn't allocate memory for ipack\n");
}
p->size = size;
@@ -34,7 +34,8 @@ void av7110_ipack_init(ipack *p, int size,
void av7110_ipack_free(ipack * p)
{
- if (p->buf) vfree(p->buf);
+ if (p->buf)
+ kfree(p->buf);
}
diff --git a/linux/drivers/media/dvb/ttpci/budget-av.c b/linux/drivers/media/dvb/ttpci/budget-av.c
index 2fa7ab6aa..95aa2fcc1 100644
--- a/linux/drivers/media/dvb/ttpci/budget-av.c
+++ b/linux/drivers/media/dvb/ttpci/budget-av.c
@@ -30,6 +30,7 @@
* the project's page is at http://www.linuxtv.org/dvb/
*/
+#include "compat.h"
#include "budget.h"
#include <media/saa7146_vv.h>
diff --git a/linux/drivers/media/dvb/ttpci/budget.c b/linux/drivers/media/dvb/ttpci/budget.c
index d4f9f7640..3188406f7 100644
--- a/linux/drivers/media/dvb/ttpci/budget.c
+++ b/linux/drivers/media/dvb/ttpci/budget.c
@@ -29,6 +29,7 @@
* the project's page is at http://www.linuxtv.org/dvb/
*/
+#include "compat.h"
#include "budget.h"
diff --git a/linux/drivers/media/dvb/ttpci/budget.h b/linux/drivers/media/dvb/ttpci/budget.h
index a76cc607b..1aaae11c6 100644
--- a/linux/drivers/media/dvb/ttpci/budget.h
+++ b/linux/drivers/media/dvb/ttpci/budget.h
@@ -1,6 +1,8 @@
#ifndef __BUDGET_DVB__
#define __BUDGET_DVB__
+#include <media/saa7146.h>
+
#include "dvb_i2c.h"
#include "dvb_frontend.h"
#include "dvbdev.h"
@@ -10,8 +12,6 @@
#include "dvb_filter.h"
#include "dvb_net.h"
-#include <media/saa7146.h>
-
extern int budget_debug;
struct budget_info {