aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2009-11-08 16:29:41 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:41:41 -0500
commit6e25abb522e055beeaf887f50a49cb370acc62b6 (patch)
tree55685065fbfbaf1fd43ad691686623682c0b9dc0 /drivers
parent054286b12c7ba7d37a945326d38716a00434002b (diff)
V4L/DVB (13399): firedtv: add missing include, rename a constant
Add #include <dvb_demux.h> for dvb_dmx_swfilter_packets(). This was already indirectly included via firedtv.h, but don't rely on it. The 4 bytes which were referred to as FIREWIRE_HEADER_SIZE are actually the source packet header from IEC 61883-4 (MPEG2-TS data transmission over 1394), not e.g. the IEEE 1394 isochronous packet header. So choose a more precise name. Also, express the payload size as a preprocessor constant too. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/dvb/firewire/firedtv-1394.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/media/dvb/firewire/firedtv-1394.c b/drivers/media/dvb/firewire/firedtv-1394.c
index 22ea4c90f5c9..82b576a4774d 100644
--- a/drivers/media/dvb/firewire/firedtv-1394.c
+++ b/drivers/media/dvb/firewire/firedtv-1394.c
@@ -26,13 +26,16 @@
26#include <iso.h> 26#include <iso.h>
27#include <nodemgr.h> 27#include <nodemgr.h>
28 28
29#include <dvb_demux.h>
30
29#include "firedtv.h" 31#include "firedtv.h"
30 32
31static LIST_HEAD(node_list); 33static LIST_HEAD(node_list);
32static DEFINE_SPINLOCK(node_list_lock); 34static DEFINE_SPINLOCK(node_list_lock);
33 35
34#define FIREWIRE_HEADER_SIZE 4 36#define CIP_HEADER_SIZE 8
35#define CIP_HEADER_SIZE 8 37#define MPEG2_TS_HEADER_SIZE 4
38#define MPEG2_TS_SOURCE_PACKET_SIZE (4 + 188)
36 39
37static void rawiso_activity_cb(struct hpsb_iso *iso) 40static void rawiso_activity_cb(struct hpsb_iso *iso)
38{ 41{
@@ -62,20 +65,20 @@ static void rawiso_activity_cb(struct hpsb_iso *iso)
62 buf = dma_region_i(&iso->data_buf, unsigned char, 65 buf = dma_region_i(&iso->data_buf, unsigned char,
63 iso->infos[packet].offset + CIP_HEADER_SIZE); 66 iso->infos[packet].offset + CIP_HEADER_SIZE);
64 count = (iso->infos[packet].len - CIP_HEADER_SIZE) / 67 count = (iso->infos[packet].len - CIP_HEADER_SIZE) /
65 (188 + FIREWIRE_HEADER_SIZE); 68 MPEG2_TS_SOURCE_PACKET_SIZE;
66 69
67 /* ignore empty packet */ 70 /* ignore empty packet */
68 if (iso->infos[packet].len <= CIP_HEADER_SIZE) 71 if (iso->infos[packet].len <= CIP_HEADER_SIZE)
69 continue; 72 continue;
70 73
71 while (count--) { 74 while (count--) {
72 if (buf[FIREWIRE_HEADER_SIZE] == 0x47) 75 if (buf[MPEG2_TS_HEADER_SIZE] == 0x47)
73 dvb_dmx_swfilter_packets(&fdtv->demux, 76 dvb_dmx_swfilter_packets(&fdtv->demux,
74 &buf[FIREWIRE_HEADER_SIZE], 1); 77 &buf[MPEG2_TS_HEADER_SIZE], 1);
75 else 78 else
76 dev_err(fdtv->device, 79 dev_err(fdtv->device,
77 "skipping invalid packet\n"); 80 "skipping invalid packet\n");
78 buf += 188 + FIREWIRE_HEADER_SIZE; 81 buf += MPEG2_TS_SOURCE_PACKET_SIZE;
79 } 82 }
80 } 83 }
81out: 84out: