V4L/DVB (13428): cx18: Rename mdl_offset to mdl_base_idx or free_mdl_idx as appropriate

Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Andy Walls 2009-11-05 21:51:24 -03:00 committed by Mauro Carvalho Chehab
parent c37b11bf17
commit fa655dda5c
3 changed files with 7 additions and 7 deletions

View file

@ -337,7 +337,7 @@ struct cx18_stream {
const char *name; /* name of the stream */ const char *name; /* name of the stream */
int type; /* stream type */ int type; /* stream type */
u32 handle; /* task handle */ u32 handle; /* task handle */
unsigned mdl_offset; unsigned int mdl_base_idx;
u32 id; u32 id;
unsigned long s_flags; /* status flags, see above */ unsigned long s_flags; /* status flags, see above */
@ -514,7 +514,7 @@ struct cx18 {
u16 buffer_id; /* buffer ID counter */ u16 buffer_id; /* buffer ID counter */
u32 v4l2_cap; /* V4L2 capabilities of card */ u32 v4l2_cap; /* V4L2 capabilities of card */
u32 hw_flags; /* Hardware description of the board */ u32 hw_flags; /* Hardware description of the board */
unsigned mdl_offset; unsigned int free_mdl_idx;
struct cx18_scb __iomem *scb; /* pointer to SCB */ struct cx18_scb __iomem *scb; /* pointer to SCB */
struct mutex epu2apu_mb_lock; /* protect driver to chip mailbox in SCB*/ struct mutex epu2apu_mb_lock; /* protect driver to chip mailbox in SCB*/
struct mutex epu2cpu_mb_lock; /* protect driver to chip mailbox in SCB*/ struct mutex epu2cpu_mb_lock; /* protect driver to chip mailbox in SCB*/

View file

@ -178,8 +178,8 @@ static void epu_dma_done(struct cx18 *cx, struct cx18_in_work_order *order)
* and send them back to q_free for fw rotation eventually. * and send them back to q_free for fw rotation eventually.
*/ */
if ((order->flags & CX18_F_EWO_MB_STALE_UPON_RECEIPT) && if ((order->flags & CX18_F_EWO_MB_STALE_UPON_RECEIPT) &&
!(id >= s->mdl_offset && !(id >= s->mdl_base_idx &&
id < (s->mdl_offset + s->buffers))) { id < (s->mdl_base_idx + s->buffers))) {
CX18_WARN("Fell behind! Ignoring stale mailbox with " CX18_WARN("Fell behind! Ignoring stale mailbox with "
" inconsistent data. Lost buffer for mailbox " " inconsistent data. Lost buffer for mailbox "
"seq no %d\n", mb->request); "seq no %d\n", mb->request);

View file

@ -194,7 +194,7 @@ int cx18_stream_alloc(struct cx18_stream *s)
s->name, s->buffers, s->buf_size, s->name, s->buffers, s->buf_size,
s->buffers * s->buf_size / 1024); s->buffers * s->buf_size / 1024);
if (((char __iomem *)&cx->scb->cpu_mdl[cx->mdl_offset + s->buffers] - if (((char __iomem *)&cx->scb->cpu_mdl[cx->free_mdl_idx + s->buffers] -
(char __iomem *)cx->scb) > SCB_RESERVED_SIZE) { (char __iomem *)cx->scb) > SCB_RESERVED_SIZE) {
unsigned bufsz = (((char __iomem *)cx->scb) + SCB_RESERVED_SIZE - unsigned bufsz = (((char __iomem *)cx->scb) + SCB_RESERVED_SIZE -
((char __iomem *)cx->scb->cpu_mdl)); ((char __iomem *)cx->scb->cpu_mdl));
@ -205,7 +205,7 @@ int cx18_stream_alloc(struct cx18_stream *s)
return -ENOMEM; return -ENOMEM;
} }
s->mdl_offset = cx->mdl_offset; s->mdl_base_idx = cx->free_mdl_idx;
/* allocate stream buffers. Initially all buffers are in q_free. */ /* allocate stream buffers. Initially all buffers are in q_free. */
for (i = 0; i < s->buffers; i++) { for (i = 0; i < s->buffers; i++) {
@ -227,7 +227,7 @@ int cx18_stream_alloc(struct cx18_stream *s)
cx18_enqueue(s, buf, &s->q_free); cx18_enqueue(s, buf, &s->q_free);
} }
if (i == s->buffers) { if (i == s->buffers) {
cx->mdl_offset += s->buffers; cx->free_mdl_idx += s->buffers;
return 0; return 0;
} }
CX18_ERR("Couldn't allocate buffers for %s stream\n", s->name); CX18_ERR("Couldn't allocate buffers for %s stream\n", s->name);