aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrandon Philips <brandon@ifup.org>2007-11-06 18:02:36 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:02:11 -0500
commit0fc0686e64d21a6abded96af2b1a895dfa8b2530 (patch)
tree6c7a696c13bccb98e9b4a95e995b7992605ed419
parent1414becf15da1701b0c45e9c82b1f120cb676a36 (diff)
V4L/DVB (6600): V4L: videobuf: don't chew up namespace STATE_.*, convert to VIDEOBUF_
s/STATE_NEEDS_INIT/VIDEOBUF_NEEDS_INIT/g s/STATE_PREPARED/VIDEOBUF_PREPARED/g s/STATE_QUEUED/VIDEOBUF_QUEUED/g s/STATE_ACTIVE/VIDEOBUF_ACTIVE/g s/STATE_DONE/VIDEOBUF_DONE/g s/STATE_ERROR/VIDEOBUF_ERROR/g s/STATE_IDLE/VIDEOBUF_IDLE/g Signed-off-by: Brandon Philips <bphilips@suse.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--drivers/media/common/saa7146_fops.c8
-rw-r--r--drivers/media/common/saa7146_vbi.c10
-rw-r--r--drivers/media/common/saa7146_video.c8
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c26
-rw-r--r--drivers/media/video/bt8xx/bttv-risc.c14
-rw-r--r--drivers/media/video/bt8xx/bttv-vbi.c6
-rw-r--r--drivers/media/video/cx23885/cx23885-core.c18
-rw-r--r--drivers/media/video/cx88/cx88-alsa.c2
-rw-r--r--drivers/media/video/cx88/cx88-core.c4
-rw-r--r--drivers/media/video/cx88/cx88-mpeg.c14
-rw-r--r--drivers/media/video/cx88/cx88-vbi.c10
-rw-r--r--drivers/media/video/cx88/cx88-video.c22
-rw-r--r--drivers/media/video/saa7134/saa7134-core.c8
-rw-r--r--drivers/media/video/saa7134/saa7134-ts.c8
-rw-r--r--drivers/media/video/saa7134/saa7134-vbi.c8
-rw-r--r--drivers/media/video/saa7134/saa7134-video.c12
-rw-r--r--drivers/media/video/videobuf-core.c50
-rw-r--r--drivers/media/video/videobuf-dvb.c2
-rw-r--r--drivers/media/video/vivi.c24
-rw-r--r--include/media/videobuf-core.h14
20 files changed, 134 insertions, 134 deletions
diff --git a/drivers/media/common/saa7146_fops.c b/drivers/media/common/saa7146_fops.c
index 67d1b1b1b254..b40bf2306fbc 100644
--- a/drivers/media/common/saa7146_fops.c
+++ b/drivers/media/common/saa7146_fops.c
@@ -61,7 +61,7 @@ void saa7146_dma_free(struct saa7146_dev *dev,struct videobuf_queue *q,
61 videobuf_waiton(&buf->vb,0,0); 61 videobuf_waiton(&buf->vb,0,0);
62 videobuf_dma_unmap(q, dma); 62 videobuf_dma_unmap(q, dma);
63 videobuf_dma_free(dma); 63 videobuf_dma_free(dma);
64 buf->vb.state = STATE_NEEDS_INIT; 64 buf->vb.state = VIDEOBUF_NEEDS_INIT;
65} 65}
66 66
67 67
@@ -83,7 +83,7 @@ int saa7146_buffer_queue(struct saa7146_dev *dev,
83 buf->activate(dev,buf,NULL); 83 buf->activate(dev,buf,NULL);
84 } else { 84 } else {
85 list_add_tail(&buf->vb.queue,&q->queue); 85 list_add_tail(&buf->vb.queue,&q->queue);
86 buf->vb.state = STATE_QUEUED; 86 buf->vb.state = VIDEOBUF_QUEUED;
87 DEB_D(("adding buffer %p to queue. (active buffer present)\n", buf)); 87 DEB_D(("adding buffer %p to queue. (active buffer present)\n", buf));
88 } 88 }
89 return 0; 89 return 0;
@@ -174,7 +174,7 @@ void saa7146_buffer_timeout(unsigned long data)
174 spin_lock_irqsave(&dev->slock,flags); 174 spin_lock_irqsave(&dev->slock,flags);
175 if (q->curr) { 175 if (q->curr) {
176 DEB_D(("timeout on %p\n", q->curr)); 176 DEB_D(("timeout on %p\n", q->curr));
177 saa7146_buffer_finish(dev,q,STATE_ERROR); 177 saa7146_buffer_finish(dev,q,VIDEOBUF_ERROR);
178 } 178 }
179 179
180 /* we don't restart the transfer here like other drivers do. when 180 /* we don't restart the transfer here like other drivers do. when
@@ -366,7 +366,7 @@ static unsigned int fops_poll(struct file *file, struct poll_table_struct *wait)
366 } 366 }
367 367
368 poll_wait(file, &buf->done, wait); 368 poll_wait(file, &buf->done, wait);
369 if (buf->state == STATE_DONE || buf->state == STATE_ERROR) { 369 if (buf->state == VIDEOBUF_DONE || buf->state == VIDEOBUF_ERROR) {
370 DEB_D(("poll succeeded!\n")); 370 DEB_D(("poll succeeded!\n"));
371 return POLLIN|POLLRDNORM; 371 return POLLIN|POLLRDNORM;
372 } 372 }
diff --git a/drivers/media/common/saa7146_vbi.c b/drivers/media/common/saa7146_vbi.c
index 6103484e4442..c32dda973e92 100644
--- a/drivers/media/common/saa7146_vbi.c
+++ b/drivers/media/common/saa7146_vbi.c
@@ -205,7 +205,7 @@ static int buffer_activate(struct saa7146_dev *dev,
205 struct saa7146_buf *next) 205 struct saa7146_buf *next)
206{ 206{
207 struct saa7146_vv *vv = dev->vv_data; 207 struct saa7146_vv *vv = dev->vv_data;
208 buf->vb.state = STATE_ACTIVE; 208 buf->vb.state = VIDEOBUF_ACTIVE;
209 209
210 DEB_VBI(("dev:%p, buf:%p, next:%p\n",dev,buf,next)); 210 DEB_VBI(("dev:%p, buf:%p, next:%p\n",dev,buf,next));
211 saa7146_set_vbi_capture(dev,buf,next); 211 saa7146_set_vbi_capture(dev,buf,next);
@@ -238,7 +238,7 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,e
238 if (buf->vb.size != size) 238 if (buf->vb.size != size)
239 saa7146_dma_free(dev,q,buf); 239 saa7146_dma_free(dev,q,buf);
240 240
241 if (STATE_NEEDS_INIT == buf->vb.state) { 241 if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
242 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); 242 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
243 243
244 buf->vb.width = llength; 244 buf->vb.width = llength;
@@ -257,7 +257,7 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,e
257 if (0 != err) 257 if (0 != err)
258 return err; 258 return err;
259 } 259 }
260 buf->vb.state = STATE_PREPARED; 260 buf->vb.state = VIDEOBUF_PREPARED;
261 buf->activate = buffer_activate; 261 buf->activate = buffer_activate;
262 262
263 return 0; 263 return 0;
@@ -335,7 +335,7 @@ static void vbi_stop(struct saa7146_fh *fh, struct file *file)
335 saa7146_write(dev, MC1, MASK_20); 335 saa7146_write(dev, MC1, MASK_20);
336 336
337 if (vv->vbi_q.curr) { 337 if (vv->vbi_q.curr) {
338 saa7146_buffer_finish(dev,&vv->vbi_q,STATE_DONE); 338 saa7146_buffer_finish(dev,&vv->vbi_q,VIDEOBUF_DONE);
339 } 339 }
340 340
341 videobuf_queue_cancel(&fh->vbi_q); 341 videobuf_queue_cancel(&fh->vbi_q);
@@ -458,7 +458,7 @@ static void vbi_irq_done(struct saa7146_dev *dev, unsigned long status)
458 /* this must be += 2, one count for each field */ 458 /* this must be += 2, one count for each field */
459 vv->vbi_fieldcount+=2; 459 vv->vbi_fieldcount+=2;
460 vv->vbi_q.curr->vb.field_count = vv->vbi_fieldcount; 460 vv->vbi_q.curr->vb.field_count = vv->vbi_fieldcount;
461 saa7146_buffer_finish(dev,&vv->vbi_q,STATE_DONE); 461 saa7146_buffer_finish(dev,&vv->vbi_q,VIDEOBUF_DONE);
462 } else { 462 } else {
463 DEB_VBI(("dev:%p\n",dev)); 463 DEB_VBI(("dev:%p\n",dev));
464 } 464 }
diff --git a/drivers/media/common/saa7146_video.c b/drivers/media/common/saa7146_video.c
index ae36d101006b..c31ab480d8e1 100644
--- a/drivers/media/common/saa7146_video.c
+++ b/drivers/media/common/saa7146_video.c
@@ -1235,7 +1235,7 @@ static int buffer_activate (struct saa7146_dev *dev,
1235{ 1235{
1236 struct saa7146_vv *vv = dev->vv_data; 1236 struct saa7146_vv *vv = dev->vv_data;
1237 1237
1238 buf->vb.state = STATE_ACTIVE; 1238 buf->vb.state = VIDEOBUF_ACTIVE;
1239 saa7146_set_capture(dev,buf,next); 1239 saa7146_set_capture(dev,buf,next);
1240 1240
1241 mod_timer(&vv->video_q.timeout, jiffies+BUFFER_TIMEOUT); 1241 mod_timer(&vv->video_q.timeout, jiffies+BUFFER_TIMEOUT);
@@ -1281,7 +1281,7 @@ static int buffer_prepare(struct videobuf_queue *q,
1281 saa7146_dma_free(dev,q,buf); 1281 saa7146_dma_free(dev,q,buf);
1282 } 1282 }
1283 1283
1284 if (STATE_NEEDS_INIT == buf->vb.state) { 1284 if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
1285 struct saa7146_format *sfmt; 1285 struct saa7146_format *sfmt;
1286 1286
1287 buf->vb.bytesperline = fh->video_fmt.bytesperline; 1287 buf->vb.bytesperline = fh->video_fmt.bytesperline;
@@ -1314,7 +1314,7 @@ static int buffer_prepare(struct videobuf_queue *q,
1314 if (err) 1314 if (err)
1315 goto oops; 1315 goto oops;
1316 } 1316 }
1317 buf->vb.state = STATE_PREPARED; 1317 buf->vb.state = VIDEOBUF_PREPARED;
1318 buf->activate = buffer_activate; 1318 buf->activate = buffer_activate;
1319 1319
1320 return 0; 1320 return 0;
@@ -1453,7 +1453,7 @@ static void video_irq_done(struct saa7146_dev *dev, unsigned long st)
1453 1453
1454 /* only finish the buffer if we have one... */ 1454 /* only finish the buffer if we have one... */
1455 if( NULL != q->curr ) { 1455 if( NULL != q->curr ) {
1456 saa7146_buffer_finish(dev,q,STATE_DONE); 1456 saa7146_buffer_finish(dev,q,VIDEOBUF_DONE);
1457 } 1457 }
1458 saa7146_buffer_next(dev,q,0); 1458 saa7146_buffer_next(dev,q,0);
1459 1459
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index db0e4b78e7dd..eb2c12eb2fc8 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -1638,7 +1638,7 @@ bttv_switch_overlay(struct bttv *btv, struct bttv_fh *fh,
1638 1638
1639 dprintk("switch_overlay: enter [new=%p]\n",new); 1639 dprintk("switch_overlay: enter [new=%p]\n",new);
1640 if (new) 1640 if (new)
1641 new->vb.state = STATE_DONE; 1641 new->vb.state = VIDEOBUF_DONE;
1642 spin_lock_irqsave(&btv->s_lock,flags); 1642 spin_lock_irqsave(&btv->s_lock,flags);
1643 old = btv->screen; 1643 old = btv->screen;
1644 btv->screen = new; 1644 btv->screen = new;
@@ -1749,7 +1749,7 @@ static int bttv_prepare_buffer(struct videobuf_queue *q,struct bttv *btv,
1749 } 1749 }
1750 1750
1751 /* alloc risc memory */ 1751 /* alloc risc memory */
1752 if (STATE_NEEDS_INIT == buf->vb.state) { 1752 if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
1753 redo_dma_risc = 1; 1753 redo_dma_risc = 1;
1754 if (0 != (rc = videobuf_iolock(q,&buf->vb,&btv->fbuf))) 1754 if (0 != (rc = videobuf_iolock(q,&buf->vb,&btv->fbuf)))
1755 goto fail; 1755 goto fail;
@@ -1759,7 +1759,7 @@ static int bttv_prepare_buffer(struct videobuf_queue *q,struct bttv *btv,
1759 if (0 != (rc = bttv_buffer_risc(btv,buf))) 1759 if (0 != (rc = bttv_buffer_risc(btv,buf)))
1760 goto fail; 1760 goto fail;
1761 1761
1762 buf->vb.state = STATE_PREPARED; 1762 buf->vb.state = VIDEOBUF_PREPARED;
1763 return 0; 1763 return 0;
1764 1764
1765 fail: 1765 fail:
@@ -1798,7 +1798,7 @@ buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb)
1798 struct bttv_fh *fh = q->priv_data; 1798 struct bttv_fh *fh = q->priv_data;
1799 struct bttv *btv = fh->btv; 1799 struct bttv *btv = fh->btv;
1800 1800
1801 buf->vb.state = STATE_QUEUED; 1801 buf->vb.state = VIDEOBUF_QUEUED;
1802 list_add_tail(&buf->vb.queue,&btv->capture); 1802 list_add_tail(&buf->vb.queue,&btv->capture);
1803 if (!btv->curr.frame_irq) { 1803 if (!btv->curr.frame_irq) {
1804 btv->loop_irq |= 1; 1804 btv->loop_irq |= 1;
@@ -3102,8 +3102,8 @@ static unsigned int bttv_poll(struct file *file, poll_table *wait)
3102 } 3102 }
3103 3103
3104 poll_wait(file, &buf->vb.done, wait); 3104 poll_wait(file, &buf->vb.done, wait);
3105 if (buf->vb.state == STATE_DONE || 3105 if (buf->vb.state == VIDEOBUF_DONE ||
3106 buf->vb.state == STATE_ERROR) 3106 buf->vb.state == VIDEOBUF_ERROR)
3107 return POLLIN|POLLRDNORM; 3107 return POLLIN|POLLRDNORM;
3108 return 0; 3108 return 0;
3109} 3109}
@@ -3699,20 +3699,20 @@ static void bttv_irq_timeout(unsigned long data)
3699 bttv_set_dma(btv, 0); 3699 bttv_set_dma(btv, 0);
3700 3700
3701 /* wake up */ 3701 /* wake up */
3702 bttv_irq_wakeup_video(btv, &old, &new, STATE_ERROR); 3702 bttv_irq_wakeup_video(btv, &old, &new, VIDEOBUF_ERROR);
3703 bttv_irq_wakeup_vbi(btv, ovbi, STATE_ERROR); 3703 bttv_irq_wakeup_vbi(btv, ovbi, VIDEOBUF_ERROR);
3704 3704
3705 /* cancel all outstanding capture / vbi requests */ 3705 /* cancel all outstanding capture / vbi requests */
3706 while (!list_empty(&btv->capture)) { 3706 while (!list_empty(&btv->capture)) {
3707 item = list_entry(btv->capture.next, struct bttv_buffer, vb.queue); 3707 item = list_entry(btv->capture.next, struct bttv_buffer, vb.queue);
3708 list_del(&item->vb.queue); 3708 list_del(&item->vb.queue);
3709 item->vb.state = STATE_ERROR; 3709 item->vb.state = VIDEOBUF_ERROR;
3710 wake_up(&item->vb.done); 3710 wake_up(&item->vb.done);
3711 } 3711 }
3712 while (!list_empty(&btv->vcapture)) { 3712 while (!list_empty(&btv->vcapture)) {
3713 item = list_entry(btv->vcapture.next, struct bttv_buffer, vb.queue); 3713 item = list_entry(btv->vcapture.next, struct bttv_buffer, vb.queue);
3714 list_del(&item->vb.queue); 3714 list_del(&item->vb.queue);
3715 item->vb.state = STATE_ERROR; 3715 item->vb.state = VIDEOBUF_ERROR;
3716 wake_up(&item->vb.done); 3716 wake_up(&item->vb.done);
3717 } 3717 }
3718 3718
@@ -3735,7 +3735,7 @@ bttv_irq_wakeup_top(struct bttv *btv)
3735 3735
3736 do_gettimeofday(&wakeup->vb.ts); 3736 do_gettimeofday(&wakeup->vb.ts);
3737 wakeup->vb.field_count = btv->field_count; 3737 wakeup->vb.field_count = btv->field_count;
3738 wakeup->vb.state = STATE_DONE; 3738 wakeup->vb.state = VIDEOBUF_DONE;
3739 wake_up(&wakeup->vb.done); 3739 wake_up(&wakeup->vb.done);
3740 spin_unlock(&btv->s_lock); 3740 spin_unlock(&btv->s_lock);
3741} 3741}
@@ -3784,7 +3784,7 @@ bttv_irq_switch_video(struct bttv *btv)
3784 } 3784 }
3785 3785
3786 /* wake up finished buffers */ 3786 /* wake up finished buffers */
3787 bttv_irq_wakeup_video(btv, &old, &new, STATE_DONE); 3787 bttv_irq_wakeup_video(btv, &old, &new, VIDEOBUF_DONE);
3788 spin_unlock(&btv->s_lock); 3788 spin_unlock(&btv->s_lock);
3789} 3789}
3790 3790
@@ -3817,7 +3817,7 @@ bttv_irq_switch_vbi(struct bttv *btv)
3817 bttv_buffer_activate_vbi(btv, new); 3817 bttv_buffer_activate_vbi(btv, new);
3818 bttv_set_dma(btv, 0); 3818 bttv_set_dma(btv, 0);
3819 3819
3820 bttv_irq_wakeup_vbi(btv, old, STATE_DONE); 3820 bttv_irq_wakeup_vbi(btv, old, VIDEOBUF_DONE);
3821 spin_unlock(&btv->s_lock); 3821 spin_unlock(&btv->s_lock);
3822} 3822}
3823 3823
diff --git a/drivers/media/video/bt8xx/bttv-risc.c b/drivers/media/video/bt8xx/bttv-risc.c
index 58986f1a5f1a..e5979f77504c 100644
--- a/drivers/media/video/bt8xx/bttv-risc.c
+++ b/drivers/media/video/bt8xx/bttv-risc.c
@@ -582,7 +582,7 @@ bttv_dma_free(struct videobuf_queue *q,struct bttv *btv, struct bttv_buffer *buf
582 videobuf_dma_free(dma); 582 videobuf_dma_free(dma);
583 btcx_riscmem_free(btv->c.pci,&buf->bottom); 583 btcx_riscmem_free(btv->c.pci,&buf->bottom);
584 btcx_riscmem_free(btv->c.pci,&buf->top); 584 btcx_riscmem_free(btv->c.pci,&buf->top);
585 buf->vb.state = STATE_NEEDS_INIT; 585 buf->vb.state = VIDEOBUF_NEEDS_INIT;
586} 586}
587 587
588int 588int
@@ -602,7 +602,7 @@ bttv_buffer_activate_vbi(struct bttv *btv,
602 if (vbi) { 602 if (vbi) {
603 unsigned int crop, vdelay; 603 unsigned int crop, vdelay;
604 604
605 vbi->vb.state = STATE_ACTIVE; 605 vbi->vb.state = VIDEOBUF_ACTIVE;
606 list_del(&vbi->vb.queue); 606 list_del(&vbi->vb.queue);
607 607
608 /* VDELAY is start of video, end of VBI capturing. */ 608 /* VDELAY is start of video, end of VBI capturing. */
@@ -644,12 +644,12 @@ bttv_buffer_activate_video(struct bttv *btv,
644 /* video capture */ 644 /* video capture */
645 if (NULL != set->top && NULL != set->bottom) { 645 if (NULL != set->top && NULL != set->bottom) {
646 if (set->top == set->bottom) { 646 if (set->top == set->bottom) {
647 set->top->vb.state = STATE_ACTIVE; 647 set->top->vb.state = VIDEOBUF_ACTIVE;
648 if (set->top->vb.queue.next) 648 if (set->top->vb.queue.next)
649 list_del(&set->top->vb.queue); 649 list_del(&set->top->vb.queue);
650 } else { 650 } else {
651 set->top->vb.state = STATE_ACTIVE; 651 set->top->vb.state = VIDEOBUF_ACTIVE;
652 set->bottom->vb.state = STATE_ACTIVE; 652 set->bottom->vb.state = VIDEOBUF_ACTIVE;
653 if (set->top->vb.queue.next) 653 if (set->top->vb.queue.next)
654 list_del(&set->top->vb.queue); 654 list_del(&set->top->vb.queue);
655 if (set->bottom->vb.queue.next) 655 if (set->bottom->vb.queue.next)
@@ -666,7 +666,7 @@ bttv_buffer_activate_video(struct bttv *btv,
666 btaor((set->top->btswap & 0x0a) | (set->bottom->btswap & 0x05), 666 btaor((set->top->btswap & 0x0a) | (set->bottom->btswap & 0x05),
667 ~0x0f, BT848_COLOR_CTL); 667 ~0x0f, BT848_COLOR_CTL);
668 } else if (NULL != set->top) { 668 } else if (NULL != set->top) {
669 set->top->vb.state = STATE_ACTIVE; 669 set->top->vb.state = VIDEOBUF_ACTIVE;
670 if (set->top->vb.queue.next) 670 if (set->top->vb.queue.next)
671 list_del(&set->top->vb.queue); 671 list_del(&set->top->vb.queue);
672 bttv_apply_geo(btv, &set->top->geo,1); 672 bttv_apply_geo(btv, &set->top->geo,1);
@@ -677,7 +677,7 @@ bttv_buffer_activate_video(struct bttv *btv,
677 btaor(set->top->btformat & 0xff, ~0xff, BT848_COLOR_FMT); 677 btaor(set->top->btformat & 0xff, ~0xff, BT848_COLOR_FMT);
678 btaor(set->top->btswap & 0x0f, ~0x0f, BT848_COLOR_CTL); 678 btaor(set->top->btswap & 0x0f, ~0x0f, BT848_COLOR_CTL);
679 } else if (NULL != set->bottom) { 679 } else if (NULL != set->bottom) {
680 set->bottom->vb.state = STATE_ACTIVE; 680 set->bottom->vb.state = VIDEOBUF_ACTIVE;
681 if (set->bottom->vb.queue.next) 681 if (set->bottom->vb.queue.next)
682 list_del(&set->bottom->vb.queue); 682 list_del(&set->bottom->vb.queue);
683 bttv_apply_geo(btv, &set->bottom->geo,1); 683 bttv_apply_geo(btv, &set->bottom->geo,1);
diff --git a/drivers/media/video/bt8xx/bttv-vbi.c b/drivers/media/video/bt8xx/bttv-vbi.c
index 346ce019bdcb..b924f05e3b74 100644
--- a/drivers/media/video/bt8xx/bttv-vbi.c
+++ b/drivers/media/video/bt8xx/bttv-vbi.c
@@ -142,7 +142,7 @@ static int vbi_buffer_prepare(struct videobuf_queue *q,
142 redo_dma_risc = 1; 142 redo_dma_risc = 1;
143 } 143 }
144 144
145 if (STATE_NEEDS_INIT == buf->vb.state) { 145 if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
146 redo_dma_risc = 1; 146 redo_dma_risc = 1;
147 if (0 != (rc = videobuf_iolock(q, &buf->vb, NULL))) 147 if (0 != (rc = videobuf_iolock(q, &buf->vb, NULL)))
148 goto fail; 148 goto fail;
@@ -189,7 +189,7 @@ static int vbi_buffer_prepare(struct videobuf_queue *q,
189 /* For bttv_buffer_activate_vbi(). */ 189 /* For bttv_buffer_activate_vbi(). */
190 buf->geo.vdelay = min_vdelay; 190 buf->geo.vdelay = min_vdelay;
191 191
192 buf->vb.state = STATE_PREPARED; 192 buf->vb.state = VIDEOBUF_PREPARED;
193 buf->vb.field = field; 193 buf->vb.field = field;
194 dprintk("buf prepare %p: top=%p bottom=%p field=%s\n", 194 dprintk("buf prepare %p: top=%p bottom=%p field=%s\n",
195 vb, &buf->top, &buf->bottom, 195 vb, &buf->top, &buf->bottom,
@@ -209,7 +209,7 @@ vbi_buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb)
209 struct bttv_buffer *buf = container_of(vb,struct bttv_buffer,vb); 209 struct bttv_buffer *buf = container_of(vb,struct bttv_buffer,vb);
210 210
211 dprintk("queue %p\n",vb); 211 dprintk("queue %p\n",vb);
212 buf->vb.state = STATE_QUEUED; 212 buf->vb.state = VIDEOBUF_QUEUED;
213 list_add_tail(&buf->vb.queue,&btv->vcapture); 213 list_add_tail(&buf->vb.queue,&btv->vcapture);
214 if (NULL == btv->cvbi) { 214 if (NULL == btv->cvbi) {
215 fh->btv->loop_irq |= 4; 215 fh->btv->loop_irq |= 4;
diff --git a/drivers/media/video/cx23885/cx23885-core.c b/drivers/media/video/cx23885/cx23885-core.c
index 0c9c9af0efb7..f205ad6354e7 100644
--- a/drivers/media/video/cx23885/cx23885-core.c
+++ b/drivers/media/video/cx23885/cx23885-core.c
@@ -378,7 +378,7 @@ static void cx23885_wakeup(struct cx23885_tsport *port,
378 do_gettimeofday(&buf->vb.ts); 378 do_gettimeofday(&buf->vb.ts);
379 dprintk(2, "[%p/%d] wakeup reg=%d buf=%d\n", buf, buf->vb.i, 379 dprintk(2, "[%p/%d] wakeup reg=%d buf=%d\n", buf, buf->vb.i,
380 count, buf->count); 380 count, buf->count);
381 buf->vb.state = STATE_DONE; 381 buf->vb.state = VIDEOBUF_DONE;
382 list_del(&buf->vb.queue); 382 list_del(&buf->vb.queue);
383 wake_up(&buf->vb.done); 383 wake_up(&buf->vb.done);
384 } 384 }
@@ -972,7 +972,7 @@ void cx23885_free_buffer(struct videobuf_queue *q, struct cx23885_buffer *buf)
972 videobuf_dma_unmap(q, dma); 972 videobuf_dma_unmap(q, dma);
973 videobuf_dma_free(dma); 973 videobuf_dma_free(dma);
974 btcx_riscmem_free((struct pci_dev *)q->dev, &buf->risc); 974 btcx_riscmem_free((struct pci_dev *)q->dev, &buf->risc);
975 buf->vb.state = STATE_NEEDS_INIT; 975 buf->vb.state = VIDEOBUF_NEEDS_INIT;
976} 976}
977 977
978static int cx23885_start_dma(struct cx23885_tsport *port, 978static int cx23885_start_dma(struct cx23885_tsport *port,
@@ -1075,7 +1075,7 @@ static int cx23885_restart_queue(struct cx23885_tsport *port,
1075 list_del(&buf->vb.queue); 1075 list_del(&buf->vb.queue);
1076 list_add_tail(&buf->vb.queue, &q->active); 1076 list_add_tail(&buf->vb.queue, &q->active);
1077 cx23885_start_dma(port, q, buf); 1077 cx23885_start_dma(port, q, buf);
1078 buf->vb.state = STATE_ACTIVE; 1078 buf->vb.state = VIDEOBUF_ACTIVE;
1079 buf->count = q->count++; 1079 buf->count = q->count++;
1080 mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); 1080 mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT);
1081 dprintk(5, "[%p/%d] restart_queue - first active\n", 1081 dprintk(5, "[%p/%d] restart_queue - first active\n",
@@ -1086,7 +1086,7 @@ static int cx23885_restart_queue(struct cx23885_tsport *port,
1086 prev->fmt == buf->fmt) { 1086 prev->fmt == buf->fmt) {
1087 list_del(&buf->vb.queue); 1087 list_del(&buf->vb.queue);
1088 list_add_tail(&buf->vb.queue, &q->active); 1088 list_add_tail(&buf->vb.queue, &q->active);
1089 buf->vb.state = STATE_ACTIVE; 1089 buf->vb.state = VIDEOBUF_ACTIVE;
1090 buf->count = q->count++; 1090 buf->count = q->count++;
1091 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); 1091 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
1092 prev->risc.jmp[2] = cpu_to_le32(0); /* 64 bit bits 63-32 */ 1092 prev->risc.jmp[2] = cpu_to_le32(0); /* 64 bit bits 63-32 */
@@ -1123,7 +1123,7 @@ int cx23885_buf_prepare(struct videobuf_queue *q, struct cx23885_tsport *port,
1123 if (0 != buf->vb.baddr && buf->vb.bsize < size) 1123 if (0 != buf->vb.baddr && buf->vb.bsize < size)
1124 return -EINVAL; 1124 return -EINVAL;
1125 1125
1126 if (STATE_NEEDS_INIT == buf->vb.state) { 1126 if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
1127 buf->vb.width = port->ts_packet_size; 1127 buf->vb.width = port->ts_packet_size;
1128 buf->vb.height = port->ts_packet_count; 1128 buf->vb.height = port->ts_packet_count;
1129 buf->vb.size = size; 1129 buf->vb.size = size;
@@ -1135,7 +1135,7 @@ int cx23885_buf_prepare(struct videobuf_queue *q, struct cx23885_tsport *port,
1135 videobuf_to_dma(&buf->vb)->sglist, 1135 videobuf_to_dma(&buf->vb)->sglist,
1136 buf->vb.width, buf->vb.height); 1136 buf->vb.width, buf->vb.height);
1137 } 1137 }
1138 buf->vb.state = STATE_PREPARED; 1138 buf->vb.state = VIDEOBUF_PREPARED;
1139 return 0; 1139 return 0;
1140 1140
1141 fail: 1141 fail:
@@ -1158,7 +1158,7 @@ void cx23885_buf_queue(struct cx23885_tsport *port, struct cx23885_buffer *buf)
1158 dprintk( 1, "queue is empty - first active\n" ); 1158 dprintk( 1, "queue is empty - first active\n" );
1159 list_add_tail(&buf->vb.queue, &cx88q->active); 1159 list_add_tail(&buf->vb.queue, &cx88q->active);
1160 cx23885_start_dma(port, cx88q, buf); 1160 cx23885_start_dma(port, cx88q, buf);
1161 buf->vb.state = STATE_ACTIVE; 1161 buf->vb.state = VIDEOBUF_ACTIVE;
1162 buf->count = cx88q->count++; 1162 buf->count = cx88q->count++;
1163 mod_timer(&cx88q->timeout, jiffies + BUFFER_TIMEOUT); 1163 mod_timer(&cx88q->timeout, jiffies + BUFFER_TIMEOUT);
1164 dprintk(1, "[%p/%d] %s - first active\n", 1164 dprintk(1, "[%p/%d] %s - first active\n",
@@ -1168,7 +1168,7 @@ void cx23885_buf_queue(struct cx23885_tsport *port, struct cx23885_buffer *buf)
1168 prev = list_entry(cx88q->active.prev, struct cx23885_buffer, 1168 prev = list_entry(cx88q->active.prev, struct cx23885_buffer,
1169 vb.queue); 1169 vb.queue);
1170 list_add_tail(&buf->vb.queue, &cx88q->active); 1170 list_add_tail(&buf->vb.queue, &cx88q->active);
1171 buf->vb.state = STATE_ACTIVE; 1171 buf->vb.state = VIDEOBUF_ACTIVE;
1172 buf->count = cx88q->count++; 1172 buf->count = cx88q->count++;
1173 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); 1173 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
1174 prev->risc.jmp[2] = cpu_to_le32(0); /* 64 bit bits 63-32 */ 1174 prev->risc.jmp[2] = cpu_to_le32(0); /* 64 bit bits 63-32 */
@@ -1192,7 +1192,7 @@ static void do_cancel_buffers(struct cx23885_tsport *port, char *reason,
1192 buf = list_entry(q->active.next, struct cx23885_buffer, 1192 buf = list_entry(q->active.next, struct cx23885_buffer,
1193 vb.queue); 1193 vb.queue);
1194 list_del(&buf->vb.queue); 1194 list_del(&buf->vb.queue);
1195 buf->vb.state = STATE_ERROR; 1195 buf->vb.state = VIDEOBUF_ERROR;
1196 wake_up(&buf->vb.done); 1196 wake_up(&buf->vb.done);
1197 dprintk(1, "[%p/%d] %s - dma=0x%08lx\n", 1197 dprintk(1, "[%p/%d] %s - dma=0x%08lx\n",
1198 buf, buf->vb.i, reason, (unsigned long)buf->risc.dma); 1198 buf, buf->vb.i, reason, (unsigned long)buf->risc.dma);
diff --git a/drivers/media/video/cx88/cx88-alsa.c b/drivers/media/video/cx88/cx88-alsa.c
index 40ffd7a5579a..8735227f7e47 100644
--- a/drivers/media/video/cx88/cx88-alsa.c
+++ b/drivers/media/video/cx88/cx88-alsa.c
@@ -417,7 +417,7 @@ static int snd_cx88_hw_params(struct snd_pcm_substream * substream,
417 buf->risc.jmp[0] = cpu_to_le32(RISC_JUMP|RISC_IRQ1|RISC_CNT_INC); 417 buf->risc.jmp[0] = cpu_to_le32(RISC_JUMP|RISC_IRQ1|RISC_CNT_INC);
418 buf->risc.jmp[1] = cpu_to_le32(buf->risc.dma); 418 buf->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
419 419
420 buf->vb.state = STATE_PREPARED; 420 buf->vb.state = VIDEOBUF_PREPARED;
421 421
422 chip->buf = buf; 422 chip->buf = buf;
423 chip->dma_risc = dma; 423 chip->dma_risc = dma;
diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c
index 62e8dd24c5f5..01e2ac98970b 100644
--- a/drivers/media/video/cx88/cx88-core.c
+++ b/drivers/media/video/cx88/cx88-core.c
@@ -220,7 +220,7 @@ cx88_free_buffer(struct videobuf_queue *q, struct cx88_buffer *buf)
220 videobuf_dma_unmap(q, dma); 220 videobuf_dma_unmap(q, dma);
221 videobuf_dma_free(dma); 221 videobuf_dma_free(dma);
222 btcx_riscmem_free((struct pci_dev *)q->dev, &buf->risc); 222 btcx_riscmem_free((struct pci_dev *)q->dev, &buf->risc);
223 buf->vb.state = STATE_NEEDS_INIT; 223 buf->vb.state = VIDEOBUF_NEEDS_INIT;
224} 224}
225 225
226/* ------------------------------------------------------------------ */ 226/* ------------------------------------------------------------------ */
@@ -538,7 +538,7 @@ void cx88_wakeup(struct cx88_core *core,
538 do_gettimeofday(&buf->vb.ts); 538 do_gettimeofday(&buf->vb.ts);
539 dprintk(2,"[%p/%d] wakeup reg=%d buf=%d\n",buf,buf->vb.i, 539 dprintk(2,"[%p/%d] wakeup reg=%d buf=%d\n",buf,buf->vb.i,
540 count, buf->count); 540 count, buf->count);
541 buf->vb.state = STATE_DONE; 541 buf->vb.state = VIDEOBUF_DONE;
542 list_del(&buf->vb.queue); 542 list_del(&buf->vb.queue);
543 wake_up(&buf->vb.done); 543 wake_up(&buf->vb.done);
544 } 544 }
diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c
index 60ac4234d84c..339a88a64f54 100644
--- a/drivers/media/video/cx88/cx88-mpeg.c
+++ b/drivers/media/video/cx88/cx88-mpeg.c
@@ -195,7 +195,7 @@ static int cx8802_restart_queue(struct cx8802_dev *dev,
195 list_del(&buf->vb.queue); 195 list_del(&buf->vb.queue);
196 list_add_tail(&buf->vb.queue,&q->active); 196 list_add_tail(&buf->vb.queue,&q->active);
197 cx8802_start_dma(dev, q, buf); 197 cx8802_start_dma(dev, q, buf);
198 buf->vb.state = STATE_ACTIVE; 198 buf->vb.state = VIDEOBUF_ACTIVE;
199 buf->count = q->count++; 199 buf->count = q->count++;
200 mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); 200 mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT);
201 dprintk(1,"[%p/%d] restart_queue - first active\n", 201 dprintk(1,"[%p/%d] restart_queue - first active\n",
@@ -206,7 +206,7 @@ static int cx8802_restart_queue(struct cx8802_dev *dev,
206 prev->fmt == buf->fmt) { 206 prev->fmt == buf->fmt) {
207 list_del(&buf->vb.queue); 207 list_del(&buf->vb.queue);
208 list_add_tail(&buf->vb.queue,&q->active); 208 list_add_tail(&buf->vb.queue,&q->active);
209 buf->vb.state = STATE_ACTIVE; 209 buf->vb.state = VIDEOBUF_ACTIVE;
210 buf->count = q->count++; 210 buf->count = q->count++;
211 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); 211 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
212 dprintk(1,"[%p/%d] restart_queue - move to active\n", 212 dprintk(1,"[%p/%d] restart_queue - move to active\n",
@@ -242,7 +242,7 @@ int cx8802_buf_prepare(struct videobuf_queue *q, struct cx8802_dev *dev,
242 if (0 != buf->vb.baddr && buf->vb.bsize < size) 242 if (0 != buf->vb.baddr && buf->vb.bsize < size)
243 return -EINVAL; 243 return -EINVAL;
244 244
245 if (STATE_NEEDS_INIT == buf->vb.state) { 245 if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
246 buf->vb.width = dev->ts_packet_size; 246 buf->vb.width = dev->ts_packet_size;
247 buf->vb.height = dev->ts_packet_count; 247 buf->vb.height = dev->ts_packet_count;
248 buf->vb.size = size; 248 buf->vb.size = size;
@@ -254,7 +254,7 @@ int cx8802_buf_prepare(struct videobuf_queue *q, struct cx8802_dev *dev,
254 dma->sglist, 254 dma->sglist,
255 buf->vb.width, buf->vb.height, 0); 255 buf->vb.width, buf->vb.height, 0);
256 } 256 }
257 buf->vb.state = STATE_PREPARED; 257 buf->vb.state = VIDEOBUF_PREPARED;
258 return 0; 258 return 0;
259 259
260 fail: 260 fail:
@@ -276,7 +276,7 @@ void cx8802_buf_queue(struct cx8802_dev *dev, struct cx88_buffer *buf)
276 dprintk( 1, "queue is empty - first active\n" ); 276 dprintk( 1, "queue is empty - first active\n" );
277 list_add_tail(&buf->vb.queue,&cx88q->active); 277 list_add_tail(&buf->vb.queue,&cx88q->active);
278 cx8802_start_dma(dev, cx88q, buf); 278 cx8802_start_dma(dev, cx88q, buf);
279 buf->vb.state = STATE_ACTIVE; 279 buf->vb.state = VIDEOBUF_ACTIVE;
280 buf->count = cx88q->count++; 280 buf->count = cx88q->count++;
281 mod_timer(&cx88q->timeout, jiffies+BUFFER_TIMEOUT); 281 mod_timer(&cx88q->timeout, jiffies+BUFFER_TIMEOUT);
282 dprintk(1,"[%p/%d] %s - first active\n", 282 dprintk(1,"[%p/%d] %s - first active\n",
@@ -286,7 +286,7 @@ void cx8802_buf_queue(struct cx8802_dev *dev, struct cx88_buffer *buf)
286 dprintk( 1, "queue is not empty - append to active\n" ); 286 dprintk( 1, "queue is not empty - append to active\n" );
287 prev = list_entry(cx88q->active.prev, struct cx88_buffer, vb.queue); 287 prev = list_entry(cx88q->active.prev, struct cx88_buffer, vb.queue);
288 list_add_tail(&buf->vb.queue,&cx88q->active); 288 list_add_tail(&buf->vb.queue,&cx88q->active);
289 buf->vb.state = STATE_ACTIVE; 289 buf->vb.state = VIDEOBUF_ACTIVE;
290 buf->count = cx88q->count++; 290 buf->count = cx88q->count++;
291 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); 291 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
292 dprintk( 1, "[%p/%d] %s - append to active\n", 292 dprintk( 1, "[%p/%d] %s - append to active\n",
@@ -306,7 +306,7 @@ static void do_cancel_buffers(struct cx8802_dev *dev, char *reason, int restart)
306 while (!list_empty(&q->active)) { 306 while (!list_empty(&q->active)) {
307 buf = list_entry(q->active.next, struct cx88_buffer, vb.queue); 307 buf = list_entry(q->active.next, struct cx88_buffer, vb.queue);
308 list_del(&buf->vb.queue); 308 list_del(&buf->vb.queue);
309 buf->vb.state = STATE_ERROR; 309 buf->vb.state = VIDEOBUF_ERROR;
310 wake_up(&buf->vb.done); 310 wake_up(&buf->vb.done);
311 dprintk(1,"[%p/%d] %s - dma=0x%08lx\n", 311 dprintk(1,"[%p/%d] %s - dma=0x%08lx\n",
312 buf, buf->vb.i, reason, (unsigned long)buf->risc.dma); 312 buf, buf->vb.i, reason, (unsigned long)buf->risc.dma);
diff --git a/drivers/media/video/cx88/cx88-vbi.c b/drivers/media/video/cx88/cx88-vbi.c
index babb08556406..d96ecfcf393a 100644
--- a/drivers/media/video/cx88/cx88-vbi.c
+++ b/drivers/media/video/cx88/cx88-vbi.c
@@ -130,7 +130,7 @@ void cx8800_vbi_timeout(unsigned long data)
130 while (!list_empty(&q->active)) { 130 while (!list_empty(&q->active)) {
131 buf = list_entry(q->active.next, struct cx88_buffer, vb.queue); 131 buf = list_entry(q->active.next, struct cx88_buffer, vb.queue);
132 list_del(&buf->vb.queue); 132 list_del(&buf->vb.queue);
133 buf->vb.state = STATE_ERROR; 133 buf->vb.state = VIDEOBUF_ERROR;
134 wake_up(&buf->vb.done); 134 wake_up(&buf->vb.done);
135 printk("%s/0: [%p/%d] timeout - dma=0x%08lx\n", dev->core->name, 135 printk("%s/0: [%p/%d] timeout - dma=0x%08lx\n", dev->core->name,
136 buf, buf->vb.i, (unsigned long)buf->risc.dma); 136 buf, buf->vb.i, (unsigned long)buf->risc.dma);
@@ -168,7 +168,7 @@ vbi_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
168 if (0 != buf->vb.baddr && buf->vb.bsize < size) 168 if (0 != buf->vb.baddr && buf->vb.bsize < size)
169 return -EINVAL; 169 return -EINVAL;
170 170
171 if (STATE_NEEDS_INIT == buf->vb.state) { 171 if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
172 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); 172 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
173 buf->vb.width = VBI_LINE_LENGTH; 173 buf->vb.width = VBI_LINE_LENGTH;
174 buf->vb.height = VBI_LINE_COUNT; 174 buf->vb.height = VBI_LINE_COUNT;
@@ -183,7 +183,7 @@ vbi_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
183 buf->vb.width, 0, 183 buf->vb.width, 0,
184 buf->vb.height); 184 buf->vb.height);
185 } 185 }
186 buf->vb.state = STATE_PREPARED; 186 buf->vb.state = VIDEOBUF_PREPARED;
187 return 0; 187 return 0;
188 188
189 fail: 189 fail:
@@ -207,7 +207,7 @@ vbi_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
207 if (list_empty(&q->active)) { 207 if (list_empty(&q->active)) {
208 list_add_tail(&buf->vb.queue,&q->active); 208 list_add_tail(&buf->vb.queue,&q->active);
209 cx8800_start_vbi_dma(dev, q, buf); 209 cx8800_start_vbi_dma(dev, q, buf);
210 buf->vb.state = STATE_ACTIVE; 210 buf->vb.state = VIDEOBUF_ACTIVE;
211 buf->count = q->count++; 211 buf->count = q->count++;
212 mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); 212 mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT);
213 dprintk(2,"[%p/%d] vbi_queue - first active\n", 213 dprintk(2,"[%p/%d] vbi_queue - first active\n",
@@ -216,7 +216,7 @@ vbi_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
216 } else { 216 } else {
217 prev = list_entry(q->active.prev, struct cx88_buffer, vb.queue); 217 prev = list_entry(q->active.prev, struct cx88_buffer, vb.queue);
218 list_add_tail(&buf->vb.queue,&q->active); 218 list_add_tail(&buf->vb.queue,&q->active);
219 buf->vb.state = STATE_ACTIVE; 219 buf->vb.state = VIDEOBUF_ACTIVE;
220 buf->count = q->count++; 220 buf->count = q->count++;
221 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); 221 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
222 dprintk(2,"[%p/%d] buffer_queue - append to active\n", 222 dprintk(2,"[%p/%d] buffer_queue - append to active\n",
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index c84dafbdb991..6d5ea8ce9830 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -486,7 +486,7 @@ static int restart_video_queue(struct cx8800_dev *dev,
486 if (NULL == prev) { 486 if (NULL == prev) {
487 list_move_tail(&buf->vb.queue, &q->active); 487 list_move_tail(&buf->vb.queue, &q->active);
488 start_video_dma(dev, q, buf); 488 start_video_dma(dev, q, buf);
489 buf->vb.state = STATE_ACTIVE; 489 buf->vb.state = VIDEOBUF_ACTIVE;
490 buf->count = q->count++; 490 buf->count = q->count++;
491 mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); 491 mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT);
492 dprintk(2,"[%p/%d] restart_queue - first active\n", 492 dprintk(2,"[%p/%d] restart_queue - first active\n",
@@ -496,7 +496,7 @@ static int restart_video_queue(struct cx8800_dev *dev,
496 prev->vb.height == buf->vb.height && 496 prev->vb.height == buf->vb.height &&
497 prev->fmt == buf->fmt) { 497 prev->fmt == buf->fmt) {
498 list_move_tail(&buf->vb.queue, &q->active); 498 list_move_tail(&buf->vb.queue, &q->active);
499 buf->vb.state = STATE_ACTIVE; 499 buf->vb.state = VIDEOBUF_ACTIVE;
500 buf->count = q->count++; 500 buf->count = q->count++;
501 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); 501 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
502 dprintk(2,"[%p/%d] restart_queue - move to active\n", 502 dprintk(2,"[%p/%d] restart_queue - move to active\n",
@@ -553,7 +553,7 @@ buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
553 init_buffer = 1; 553 init_buffer = 1;
554 } 554 }
555 555
556 if (STATE_NEEDS_INIT == buf->vb.state) { 556 if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
557 init_buffer = 1; 557 init_buffer = 1;
558 if (0 != (rc = videobuf_iolock(q,&buf->vb,NULL))) 558 if (0 != (rc = videobuf_iolock(q,&buf->vb,NULL)))
559 goto fail; 559 goto fail;
@@ -601,7 +601,7 @@ buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
601 fh->width, fh->height, fh->fmt->depth, fh->fmt->name, 601 fh->width, fh->height, fh->fmt->depth, fh->fmt->name,
602 (unsigned long)buf->risc.dma); 602 (unsigned long)buf->risc.dma);
603 603
604 buf->vb.state = STATE_PREPARED; 604 buf->vb.state = VIDEOBUF_PREPARED;
605 return 0; 605 return 0;
606 606
607 fail: 607 fail:
@@ -625,14 +625,14 @@ buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
625 625
626 if (!list_empty(&q->queued)) { 626 if (!list_empty(&q->queued)) {
627 list_add_tail(&buf->vb.queue,&q->queued); 627 list_add_tail(&buf->vb.queue,&q->queued);
628 buf->vb.state = STATE_QUEUED; 628 buf->vb.state = VIDEOBUF_QUEUED;
629 dprintk(2,"[%p/%d] buffer_queue - append to queued\n", 629 dprintk(2,"[%p/%d] buffer_queue - append to queued\n",
630 buf, buf->vb.i); 630 buf, buf->vb.i);
631 631
632 } else if (list_empty(&q->active)) { 632 } else if (list_empty(&q->active)) {
633 list_add_tail(&buf->vb.queue,&q->active); 633 list_add_tail(&buf->vb.queue,&q->active);
634 start_video_dma(dev, q, buf); 634 start_video_dma(dev, q, buf);
635 buf->vb.state = STATE_ACTIVE; 635 buf->vb.state = VIDEOBUF_ACTIVE;
636 buf->count = q->count++; 636 buf->count = q->count++;
637 mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); 637 mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT);
638 dprintk(2,"[%p/%d] buffer_queue - first active\n", 638 dprintk(2,"[%p/%d] buffer_queue - first active\n",
@@ -644,7 +644,7 @@ buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
644 prev->vb.height == buf->vb.height && 644 prev->vb.height == buf->vb.height &&
645 prev->fmt == buf->fmt) { 645 prev->fmt == buf->fmt) {
646 list_add_tail(&buf->vb.queue,&q->active); 646 list_add_tail(&buf->vb.queue,&q->active);
647 buf->vb.state = STATE_ACTIVE; 647 buf->vb.state = VIDEOBUF_ACTIVE;
648 buf->count = q->count++; 648 buf->count = q->count++;
649 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); 649 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
650 dprintk(2,"[%p/%d] buffer_queue - append to active\n", 650 dprintk(2,"[%p/%d] buffer_queue - append to active\n",
@@ -652,7 +652,7 @@ buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
652 652
653 } else { 653 } else {
654 list_add_tail(&buf->vb.queue,&q->queued); 654 list_add_tail(&buf->vb.queue,&q->queued);
655 buf->vb.state = STATE_QUEUED; 655 buf->vb.state = VIDEOBUF_QUEUED;
656 dprintk(2,"[%p/%d] buffer_queue - first queued\n", 656 dprintk(2,"[%p/%d] buffer_queue - first queued\n",
657 buf, buf->vb.i); 657 buf, buf->vb.i);
658 } 658 }
@@ -822,8 +822,8 @@ video_poll(struct file *file, struct poll_table_struct *wait)
822 return POLLERR; 822 return POLLERR;
823 } 823 }
824 poll_wait(file, &buf->vb.done, wait); 824 poll_wait(file, &buf->vb.done, wait);
825 if (buf->vb.state == STATE_DONE || 825 if (buf->vb.state == VIDEOBUF_DONE ||
826 buf->vb.state == STATE_ERROR) 826 buf->vb.state == VIDEOBUF_ERROR)
827 return POLLIN|POLLRDNORM; 827 return POLLIN|POLLRDNORM;
828 return 0; 828 return 0;
829} 829}
@@ -1496,7 +1496,7 @@ static void cx8800_vid_timeout(unsigned long data)
1496 while (!list_empty(&q->active)) { 1496 while (!list_empty(&q->active)) {
1497 buf = list_entry(q->active.next, struct cx88_buffer, vb.queue); 1497 buf = list_entry(q->active.next, struct cx88_buffer, vb.queue);
1498 list_del(&buf->vb.queue); 1498 list_del(&buf->vb.queue);
1499 buf->vb.state = STATE_ERROR; 1499 buf->vb.state = VIDEOBUF_ERROR;
1500 wake_up(&buf->vb.done); 1500 wake_up(&buf->vb.done);
1501 printk("%s/0: [%p/%d] timeout - dma=0x%08lx\n", core->name, 1501 printk("%s/0: [%p/%d] timeout - dma=0x%08lx\n", core->name,
1502 buf, buf->vb.i, (unsigned long)buf->risc.dma); 1502 buf, buf->vb.i, (unsigned long)buf->risc.dma);
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index fc71843b9dc2..76410f5bdcdd 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -294,7 +294,7 @@ void saa7134_dma_free(struct videobuf_queue *q,struct saa7134_buf *buf)
294 videobuf_waiton(&buf->vb,0,0); 294 videobuf_waiton(&buf->vb,0,0);
295 videobuf_dma_unmap(q, dma); 295 videobuf_dma_unmap(q, dma);
296 videobuf_dma_free(dma); 296 videobuf_dma_free(dma);
297 buf->vb.state = STATE_NEEDS_INIT; 297 buf->vb.state = VIDEOBUF_NEEDS_INIT;
298} 298}
299 299
300/* ------------------------------------------------------------------ */ 300/* ------------------------------------------------------------------ */
@@ -313,7 +313,7 @@ int saa7134_buffer_queue(struct saa7134_dev *dev,
313 buf->activate(dev,buf,NULL); 313 buf->activate(dev,buf,NULL);
314 } else if (list_empty(&q->queue)) { 314 } else if (list_empty(&q->queue)) {
315 list_add_tail(&buf->vb.queue,&q->queue); 315 list_add_tail(&buf->vb.queue,&q->queue);
316 buf->vb.state = STATE_QUEUED; 316 buf->vb.state = VIDEOBUF_QUEUED;
317 } else { 317 } else {
318 next = list_entry(q->queue.next,struct saa7134_buf, 318 next = list_entry(q->queue.next,struct saa7134_buf,
319 vb.queue); 319 vb.queue);
@@ -322,7 +322,7 @@ int saa7134_buffer_queue(struct saa7134_dev *dev,
322 } 322 }
323 } else { 323 } else {
324 list_add_tail(&buf->vb.queue,&q->queue); 324 list_add_tail(&buf->vb.queue,&q->queue);
325 buf->vb.state = STATE_QUEUED; 325 buf->vb.state = VIDEOBUF_QUEUED;
326 } 326 }
327 return 0; 327 return 0;
328} 328}
@@ -387,7 +387,7 @@ void saa7134_buffer_timeout(unsigned long data)
387 try to start over with the next one. */ 387 try to start over with the next one. */
388 if (q->curr) { 388 if (q->curr) {
389 dprintk("timeout on %p\n",q->curr); 389 dprintk("timeout on %p\n",q->curr);
390 saa7134_buffer_finish(dev,q,STATE_ERROR); 390 saa7134_buffer_finish(dev,q,VIDEOBUF_ERROR);
391 } 391 }
392 saa7134_buffer_next(dev,q); 392 saa7134_buffer_next(dev,q);
393 spin_unlock_irqrestore(&dev->slock,flags); 393 spin_unlock_irqrestore(&dev->slock,flags);
diff --git a/drivers/media/video/saa7134/saa7134-ts.c b/drivers/media/video/saa7134/saa7134-ts.c
index 4b63ad3e8466..f1b8fcaeb43a 100644
--- a/drivers/media/video/saa7134/saa7134-ts.c
+++ b/drivers/media/video/saa7134/saa7134-ts.c
@@ -47,7 +47,7 @@ static int buffer_activate(struct saa7134_dev *dev,
47{ 47{
48 48
49 dprintk("buffer_activate [%p]",buf); 49 dprintk("buffer_activate [%p]",buf);
50 buf->vb.state = STATE_ACTIVE; 50 buf->vb.state = VIDEOBUF_ACTIVE;
51 buf->top_seen = 0; 51 buf->top_seen = 0;
52 52
53 if (NULL == next) 53 if (NULL == next)
@@ -91,7 +91,7 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
91 saa7134_dma_free(q,buf); 91 saa7134_dma_free(q,buf);
92 } 92 }
93 93
94 if (STATE_NEEDS_INIT == buf->vb.state) { 94 if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
95 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); 95 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
96 96
97 buf->vb.width = llength; 97 buf->vb.width = llength;
@@ -121,7 +121,7 @@ static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,
121 saa_writel(SAA7134_RS_PITCH(5),TS_PACKET_SIZE); 121 saa_writel(SAA7134_RS_PITCH(5),TS_PACKET_SIZE);
122 saa_writel(SAA7134_RS_CONTROL(5),control); 122 saa_writel(SAA7134_RS_CONTROL(5),control);
123 123
124 buf->vb.state = STATE_PREPARED; 124 buf->vb.state = VIDEOBUF_PREPARED;
125 buf->activate = buffer_activate; 125 buf->activate = buffer_activate;
126 buf->vb.field = field; 126 buf->vb.field = field;
127 return 0; 127 return 0;
@@ -242,7 +242,7 @@ void saa7134_irq_ts_done(struct saa7134_dev *dev, unsigned long status)
242 if ((status & 0x100000) != 0x100000) 242 if ((status & 0x100000) != 0x100000)
243 goto done; 243 goto done;
244 } 244 }
245 saa7134_buffer_finish(dev,&dev->ts_q,STATE_DONE); 245 saa7134_buffer_finish(dev,&dev->ts_q,VIDEOBUF_DONE);
246 } 246 }
247 saa7134_buffer_next(dev,&dev->ts_q); 247 saa7134_buffer_next(dev,&dev->ts_q);
248 248
diff --git a/drivers/media/video/saa7134/saa7134-vbi.c b/drivers/media/video/saa7134/saa7134-vbi.c
index 81a2aedeff5c..f0d5ed9c2b06 100644
--- a/drivers/media/video/saa7134/saa7134-vbi.c
+++ b/drivers/media/video/saa7134/saa7134-vbi.c
@@ -85,7 +85,7 @@ static int buffer_activate(struct saa7134_dev *dev,
85 unsigned long control,base; 85 unsigned long control,base;
86 86
87 dprintk("buffer_activate [%p]\n",buf); 87 dprintk("buffer_activate [%p]\n",buf);
88 buf->vb.state = STATE_ACTIVE; 88 buf->vb.state = VIDEOBUF_ACTIVE;
89 buf->top_seen = 0; 89 buf->top_seen = 0;
90 90
91 task_init(dev,buf,TASK_A); 91 task_init(dev,buf,TASK_A);
@@ -136,7 +136,7 @@ static int buffer_prepare(struct videobuf_queue *q,
136 if (buf->vb.size != size) 136 if (buf->vb.size != size)
137 saa7134_dma_free(q,buf); 137 saa7134_dma_free(q,buf);
138 138
139 if (STATE_NEEDS_INIT == buf->vb.state) { 139 if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
140 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); 140 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
141 141
142 buf->vb.width = llength; 142 buf->vb.width = llength;
@@ -154,7 +154,7 @@ static int buffer_prepare(struct videobuf_queue *q,
154 if (err) 154 if (err)
155 goto oops; 155 goto oops;
156 } 156 }
157 buf->vb.state = STATE_PREPARED; 157 buf->vb.state = VIDEOBUF_PREPARED;
158 buf->activate = buffer_activate; 158 buf->activate = buffer_activate;
159 buf->vb.field = field; 159 buf->vb.field = field;
160 return 0; 160 return 0;
@@ -240,7 +240,7 @@ void saa7134_irq_vbi_done(struct saa7134_dev *dev, unsigned long status)
240 goto done; 240 goto done;
241 241
242 dev->vbi_q.curr->vb.field_count = dev->vbi_fieldcount; 242 dev->vbi_q.curr->vb.field_count = dev->vbi_fieldcount;
243 saa7134_buffer_finish(dev,&dev->vbi_q,STATE_DONE); 243 saa7134_buffer_finish(dev,&dev->vbi_q,VIDEOBUF_DONE);
244 } 244 }
245 saa7134_buffer_next(dev,&dev->vbi_q); 245 saa7134_buffer_next(dev,&dev->vbi_q);
246 246
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index 86fe452842b3..9c160b2bca3d 100644
--- a/drivers/media/video/saa7134/saa7134-video.c
+++ b/drivers/media/video/saa7134/saa7134-video.c
@@ -945,7 +945,7 @@ static int buffer_activate(struct saa7134_dev *dev,
945 unsigned long bpl_uv,lines_uv,base2,base3,tmp; /* planar */ 945 unsigned long bpl_uv,lines_uv,base2,base3,tmp; /* planar */
946 946
947 dprintk("buffer_activate buf=%p\n",buf); 947 dprintk("buffer_activate buf=%p\n",buf);
948 buf->vb.state = STATE_ACTIVE; 948 buf->vb.state = VIDEOBUF_ACTIVE;
949 buf->top_seen = 0; 949 buf->top_seen = 0;
950 950
951 set_size(dev,TASK_A,buf->vb.width,buf->vb.height, 951 set_size(dev,TASK_A,buf->vb.width,buf->vb.height,
@@ -1054,7 +1054,7 @@ static int buffer_prepare(struct videobuf_queue *q,
1054 saa7134_dma_free(q,buf); 1054 saa7134_dma_free(q,buf);
1055 } 1055 }
1056 1056
1057 if (STATE_NEEDS_INIT == buf->vb.state) { 1057 if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
1058 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); 1058 struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb);
1059 1059
1060 buf->vb.width = fh->width; 1060 buf->vb.width = fh->width;
@@ -1074,7 +1074,7 @@ static int buffer_prepare(struct videobuf_queue *q,
1074 if (err) 1074 if (err)
1075 goto oops; 1075 goto oops;
1076 } 1076 }
1077 buf->vb.state = STATE_PREPARED; 1077 buf->vb.state = VIDEOBUF_PREPARED;
1078 buf->activate = buffer_activate; 1078 buf->activate = buffer_activate;
1079 return 0; 1079 return 0;
1080 1080
@@ -1421,8 +1421,8 @@ video_poll(struct file *file, struct poll_table_struct *wait)
1421 return POLLERR; 1421 return POLLERR;
1422 1422
1423 poll_wait(file, &buf->done, wait); 1423 poll_wait(file, &buf->done, wait);
1424 if (buf->state == STATE_DONE || 1424 if (buf->state == VIDEOBUF_DONE ||
1425 buf->state == STATE_ERROR) 1425 buf->state == VIDEOBUF_ERROR)
1426 return POLLIN|POLLRDNORM; 1426 return POLLIN|POLLRDNORM;
1427 return 0; 1427 return 0;
1428} 1428}
@@ -2519,7 +2519,7 @@ void saa7134_irq_video_done(struct saa7134_dev *dev, unsigned long status)
2519 goto done; 2519 goto done;
2520 } 2520 }
2521 dev->video_q.curr->vb.field_count = dev->video_fieldcount; 2521 dev->video_q.curr->vb.field_count = dev->video_fieldcount;
2522 saa7134_buffer_finish(dev,&dev->video_q,STATE_DONE); 2522 saa7134_buffer_finish(dev,&dev->video_q,VIDEOBUF_DONE);
2523 } 2523 }
2524 saa7134_buffer_next(dev,&dev->video_q); 2524 saa7134_buffer_next(dev,&dev->video_q);
2525 2525
diff --git a/drivers/media/video/videobuf-core.c b/drivers/media/video/videobuf-core.c
index c8a5cb57963b..26d1a5001738 100644
--- a/drivers/media/video/videobuf-core.c
+++ b/drivers/media/video/videobuf-core.c
@@ -68,14 +68,14 @@ int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr)
68 68
69 MAGIC_CHECK(vb->magic,MAGIC_BUFFER); 69 MAGIC_CHECK(vb->magic,MAGIC_BUFFER);
70 add_wait_queue(&vb->done, &wait); 70 add_wait_queue(&vb->done, &wait);
71 while (vb->state == STATE_ACTIVE || vb->state == STATE_QUEUED) { 71 while (vb->state == VIDEOBUF_ACTIVE || vb->state == VIDEOBUF_QUEUED) {
72 if (non_blocking) { 72 if (non_blocking) {
73 retval = -EAGAIN; 73 retval = -EAGAIN;
74 break; 74 break;
75 } 75 }
76 set_current_state(intr ? TASK_INTERRUPTIBLE 76 set_current_state(intr ? TASK_INTERRUPTIBLE
77 : TASK_UNINTERRUPTIBLE); 77 : TASK_UNINTERRUPTIBLE);
78 if (vb->state == STATE_ACTIVE || vb->state == STATE_QUEUED) 78 if (vb->state == VIDEOBUF_ACTIVE || vb->state == VIDEOBUF_QUEUED)
79 schedule(); 79 schedule();
80 set_current_state(TASK_RUNNING); 80 set_current_state(TASK_RUNNING);
81 if (intr && signal_pending(current)) { 81 if (intr && signal_pending(current)) {
@@ -167,11 +167,11 @@ int videobuf_queue_is_busy(struct videobuf_queue *q)
167 dprintk(1,"busy: buffer #%d mapped\n",i); 167 dprintk(1,"busy: buffer #%d mapped\n",i);
168 return 1; 168 return 1;
169 } 169 }
170 if (q->bufs[i]->state == STATE_QUEUED) { 170 if (q->bufs[i]->state == VIDEOBUF_QUEUED) {
171 dprintk(1,"busy: buffer #%d queued\n",i); 171 dprintk(1,"busy: buffer #%d queued\n",i);
172 return 1; 172 return 1;
173 } 173 }
174 if (q->bufs[i]->state == STATE_ACTIVE) { 174 if (q->bufs[i]->state == VIDEOBUF_ACTIVE) {
175 dprintk(1,"busy: buffer #%d avtive\n",i); 175 dprintk(1,"busy: buffer #%d avtive\n",i);
176 return 1; 176 return 1;
177 } 177 }
@@ -191,9 +191,9 @@ void videobuf_queue_cancel(struct videobuf_queue *q)
191 for (i = 0; i < VIDEO_MAX_FRAME; i++) { 191 for (i = 0; i < VIDEO_MAX_FRAME; i++) {
192 if (NULL == q->bufs[i]) 192 if (NULL == q->bufs[i])
193 continue; 193 continue;
194 if (q->bufs[i]->state == STATE_QUEUED) { 194 if (q->bufs[i]->state == VIDEOBUF_QUEUED) {
195 list_del(&q->bufs[i]->queue); 195 list_del(&q->bufs[i]->queue);
196 q->bufs[i]->state = STATE_ERROR; 196 q->bufs[i]->state = VIDEOBUF_ERROR;
197 } 197 }
198 } 198 }
199 if (q->irqlock) 199 if (q->irqlock)
@@ -259,17 +259,17 @@ static void videobuf_status(struct videobuf_queue *q, struct v4l2_buffer *b,
259 b->flags |= V4L2_BUF_FLAG_MAPPED; 259 b->flags |= V4L2_BUF_FLAG_MAPPED;
260 260
261 switch (vb->state) { 261 switch (vb->state) {
262 case STATE_PREPARED: 262 case VIDEOBUF_PREPARED:
263 case STATE_QUEUED: 263 case VIDEOBUF_QUEUED:
264 case STATE_ACTIVE: 264 case VIDEOBUF_ACTIVE:
265 b->flags |= V4L2_BUF_FLAG_QUEUED; 265 b->flags |= V4L2_BUF_FLAG_QUEUED;
266 break; 266 break;
267 case STATE_DONE: 267 case VIDEOBUF_DONE:
268 case STATE_ERROR: 268 case VIDEOBUF_ERROR:
269 b->flags |= V4L2_BUF_FLAG_DONE; 269 b->flags |= V4L2_BUF_FLAG_DONE;
270 break; 270 break;
271 case STATE_NEEDS_INIT: 271 case VIDEOBUF_NEEDS_INIT:
272 case STATE_IDLE: 272 case VIDEOBUF_IDLE:
273 /* nothing */ 273 /* nothing */
274 break; 274 break;
275 } 275 }
@@ -498,7 +498,7 @@ int videobuf_qbuf(struct videobuf_queue *q,
498 dprintk(1,"qbuf: memory type is wrong.\n"); 498 dprintk(1,"qbuf: memory type is wrong.\n");
499 goto done; 499 goto done;
500 } 500 }
501 if (buf->state != STATE_NEEDS_INIT && buf->state != STATE_IDLE) { 501 if (buf->state != VIDEOBUF_NEEDS_INIT && buf->state != VIDEOBUF_IDLE) {
502 dprintk(1,"qbuf: buffer is already queued or active.\n"); 502 dprintk(1,"qbuf: buffer is already queued or active.\n");
503 goto done; 503 goto done;
504 } 504 }
@@ -525,7 +525,7 @@ int videobuf_qbuf(struct videobuf_queue *q,
525 dprintk(1,"qbuf: buffer length is not enough\n"); 525 dprintk(1,"qbuf: buffer length is not enough\n");
526 goto done; 526 goto done;
527 } 527 }
528 if (STATE_NEEDS_INIT != buf->state && buf->baddr != b->m.userptr) 528 if (VIDEOBUF_NEEDS_INIT != buf->state && buf->baddr != b->m.userptr)
529 q->ops->buf_release(q,buf); 529 q->ops->buf_release(q,buf);
530 buf->baddr = b->m.userptr; 530 buf->baddr = b->m.userptr;
531 break; 531 break;
@@ -595,16 +595,16 @@ int videobuf_dqbuf(struct videobuf_queue *q,
595 goto done; 595 goto done;
596 } 596 }
597 switch (buf->state) { 597 switch (buf->state) {
598 case STATE_ERROR: 598 case VIDEOBUF_ERROR:
599 dprintk(1,"dqbuf: state is error\n"); 599 dprintk(1,"dqbuf: state is error\n");
600 retval = -EIO; 600 retval = -EIO;
601 CALL(q,sync,q, buf); 601 CALL(q,sync,q, buf);
602 buf->state = STATE_IDLE; 602 buf->state = VIDEOBUF_IDLE;
603 break; 603 break;
604 case STATE_DONE: 604 case VIDEOBUF_DONE:
605 dprintk(1,"dqbuf: state is done\n"); 605 dprintk(1,"dqbuf: state is done\n");
606 CALL(q,sync,q, buf); 606 CALL(q,sync,q, buf);
607 buf->state = STATE_IDLE; 607 buf->state = VIDEOBUF_IDLE;
608 break; 608 break;
609 default: 609 default:
610 dprintk(1,"dqbuf: state invalid\n"); 610 dprintk(1,"dqbuf: state invalid\n");
@@ -637,7 +637,7 @@ int videobuf_streamon(struct videobuf_queue *q)
637 if (q->irqlock) 637 if (q->irqlock)
638 spin_lock_irqsave(q->irqlock,flags); 638 spin_lock_irqsave(q->irqlock,flags);
639 list_for_each_entry(buf, &q->stream, stream) 639 list_for_each_entry(buf, &q->stream, stream)
640 if (buf->state == STATE_PREPARED) 640 if (buf->state == VIDEOBUF_PREPARED)
641 q->ops->buf_queue(q,buf); 641 q->ops->buf_queue(q,buf);
642 if (q->irqlock) 642 if (q->irqlock)
643 spin_unlock_irqrestore(q->irqlock,flags); 643 spin_unlock_irqrestore(q->irqlock,flags);
@@ -704,7 +704,7 @@ static ssize_t videobuf_read_zerocopy(struct videobuf_queue *q,
704 retval = videobuf_waiton(q->read_buf,0,0); 704 retval = videobuf_waiton(q->read_buf,0,0);
705 if (0 == retval) { 705 if (0 == retval) {
706 CALL(q,sync,q,q->read_buf); 706 CALL(q,sync,q,q->read_buf);
707 if (STATE_ERROR == q->read_buf->state) 707 if (VIDEOBUF_ERROR == q->read_buf->state)
708 retval = -EIO; 708 retval = -EIO;
709 else 709 else
710 retval = q->read_buf->size; 710 retval = q->read_buf->size;
@@ -778,7 +778,7 @@ ssize_t videobuf_read_one(struct videobuf_queue *q,
778 778
779 CALL(q,sync,q,q->read_buf); 779 CALL(q,sync,q,q->read_buf);
780 780
781 if (STATE_ERROR == q->read_buf->state) { 781 if (VIDEOBUF_ERROR == q->read_buf->state) {
782 /* catch I/O errors */ 782 /* catch I/O errors */
783 q->ops->buf_release(q,q->read_buf); 783 q->ops->buf_release(q,q->read_buf);
784 kfree(q->read_buf); 784 kfree(q->read_buf);
@@ -931,7 +931,7 @@ ssize_t videobuf_read_stream(struct videobuf_queue *q,
931 break; 931 break;
932 } 932 }
933 933
934 if (q->read_buf->state == STATE_DONE) { 934 if (q->read_buf->state == VIDEOBUF_DONE) {
935 rc = CALL (q,copy_stream, q, data + retval, count, 935 rc = CALL (q,copy_stream, q, data + retval, count,
936 retval, vbihack, nonblocking); 936 retval, vbihack, nonblocking);
937 if (rc < 0) { 937 if (rc < 0) {
@@ -999,8 +999,8 @@ unsigned int videobuf_poll_stream(struct file *file,
999 999
1000 if (0 == rc) { 1000 if (0 == rc) {
1001 poll_wait(file, &buf->done, wait); 1001 poll_wait(file, &buf->done, wait);
1002 if (buf->state == STATE_DONE || 1002 if (buf->state == VIDEOBUF_DONE ||
1003 buf->state == STATE_ERROR) 1003 buf->state == VIDEOBUF_ERROR)
1004 rc = POLLIN|POLLRDNORM; 1004 rc = POLLIN|POLLRDNORM;
1005 } 1005 }
1006 mutex_unlock(&q->lock); 1006 mutex_unlock(&q->lock);
diff --git a/drivers/media/video/videobuf-dvb.c b/drivers/media/video/videobuf-dvb.c
index 880317e04a02..b73aba65d21d 100644
--- a/drivers/media/video/videobuf-dvb.c
+++ b/drivers/media/video/videobuf-dvb.c
@@ -67,7 +67,7 @@ static int videobuf_dvb_thread(void *data)
67 67
68 /* feed buffer data to demux */ 68 /* feed buffer data to demux */
69 dma=videobuf_to_dma(buf); 69 dma=videobuf_to_dma(buf);
70 if (buf->state == STATE_DONE) 70 if (buf->state == VIDEOBUF_DONE)
71 dvb_dmx_swfilter(&dvb->demux, dma->vmalloc, 71 dvb_dmx_swfilter(&dvb->demux, dma->vmalloc,
72 buf->size); 72 buf->size);
73 73
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index 9b54ff9d2e36..fe9784a0cc21 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -370,7 +370,7 @@ static void vivi_fillbuff(struct vivi_dev *dev,struct vivi_buffer *buf)
370 (unsigned long)tmpbuf,pos); 370 (unsigned long)tmpbuf,pos);
371 371
372 /* Advice that buffer was filled */ 372 /* Advice that buffer was filled */
373 buf->vb.state = STATE_DONE; 373 buf->vb.state = VIDEOBUF_DONE;
374 buf->vb.field_count++; 374 buf->vb.field_count++;
375 do_gettimeofday(&ts); 375 do_gettimeofday(&ts);
376 buf->vb.ts = ts; 376 buf->vb.ts = ts;
@@ -522,7 +522,7 @@ static int restart_video_queue(struct vivi_dmaqueue *dma_q)
522 /* cancel all outstanding capture / vbi requests */ 522 /* cancel all outstanding capture / vbi requests */
523 list_for_each_entry_safe(buf, prev, &dma_q->active, vb.queue) { 523 list_for_each_entry_safe(buf, prev, &dma_q->active, vb.queue) {
524 list_del(&buf->vb.queue); 524 list_del(&buf->vb.queue);
525 buf->vb.state = STATE_ERROR; 525 buf->vb.state = VIDEOBUF_ERROR;
526 wake_up(&buf->vb.done); 526 wake_up(&buf->vb.done);
527 } 527 }
528 mod_timer(&dma_q->timeout, jiffies+BUFFER_TIMEOUT); 528 mod_timer(&dma_q->timeout, jiffies+BUFFER_TIMEOUT);
@@ -543,7 +543,7 @@ static int restart_video_queue(struct vivi_dmaqueue *dma_q)
543 vivi_stop_thread(dma_q); 543 vivi_stop_thread(dma_q);
544 vivi_start_thread(dma_q); 544 vivi_start_thread(dma_q);
545 545
546 buf->vb.state = STATE_ACTIVE; 546 buf->vb.state = VIDEOBUF_ACTIVE;
547 mod_timer(&dma_q->timeout, jiffies+BUFFER_TIMEOUT); 547 mod_timer(&dma_q->timeout, jiffies+BUFFER_TIMEOUT);
548 dprintk(2,"[%p/%d] restart_queue - first active\n", 548 dprintk(2,"[%p/%d] restart_queue - first active\n",
549 buf,buf->vb.i); 549 buf,buf->vb.i);
@@ -553,7 +553,7 @@ static int restart_video_queue(struct vivi_dmaqueue *dma_q)
553 prev->fmt == buf->fmt) { 553 prev->fmt == buf->fmt) {
554 list_del(&buf->vb.queue); 554 list_del(&buf->vb.queue);
555 list_add_tail(&buf->vb.queue,&dma_q->active); 555 list_add_tail(&buf->vb.queue,&dma_q->active);
556 buf->vb.state = STATE_ACTIVE; 556 buf->vb.state = VIDEOBUF_ACTIVE;
557 dprintk(2,"[%p/%d] restart_queue - move to active\n", 557 dprintk(2,"[%p/%d] restart_queue - move to active\n",
558 buf,buf->vb.i); 558 buf,buf->vb.i);
559 } else { 559 } else {
@@ -572,7 +572,7 @@ static void vivi_vid_timeout(unsigned long data)
572 while (!list_empty(&vidq->active)) { 572 while (!list_empty(&vidq->active)) {
573 buf = list_entry(vidq->active.next, struct vivi_buffer, vb.queue); 573 buf = list_entry(vidq->active.next, struct vivi_buffer, vb.queue);
574 list_del(&buf->vb.queue); 574 list_del(&buf->vb.queue);
575 buf->vb.state = STATE_ERROR; 575 buf->vb.state = VIDEOBUF_ERROR;
576 wake_up(&buf->vb.done); 576 wake_up(&buf->vb.done);
577 printk("vivi/0: [%p/%d] timeout\n", buf, buf->vb.i); 577 printk("vivi/0: [%p/%d] timeout\n", buf, buf->vb.i);
578 } 578 }
@@ -610,7 +610,7 @@ static void free_buffer(struct videobuf_queue *vq, struct vivi_buffer *buf)
610 610
611 videobuf_waiton(&buf->vb,0,0); 611 videobuf_waiton(&buf->vb,0,0);
612 videobuf_vmalloc_free(&buf->vb); 612 videobuf_vmalloc_free(&buf->vb);
613 buf->vb.state = STATE_NEEDS_INIT; 613 buf->vb.state = VIDEOBUF_NEEDS_INIT;
614} 614}
615 615
616#define norm_maxw() 1024 616#define norm_maxw() 1024
@@ -644,12 +644,12 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
644 init_buffer = 1; 644 init_buffer = 1;
645 } 645 }
646 646
647 if (STATE_NEEDS_INIT == buf->vb.state) { 647 if (VIDEOBUF_NEEDS_INIT == buf->vb.state) {
648 if (0 != (rc = videobuf_iolock(vq,&buf->vb,NULL))) 648 if (0 != (rc = videobuf_iolock(vq,&buf->vb,NULL)))
649 goto fail; 649 goto fail;
650 } 650 }
651 651
652 buf->vb.state = STATE_PREPARED; 652 buf->vb.state = VIDEOBUF_PREPARED;
653 653
654 return 0; 654 return 0;
655 655
@@ -670,13 +670,13 @@ buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
670 if (!list_empty(&vidq->queued)) { 670 if (!list_empty(&vidq->queued)) {
671 dprintk(1,"adding vb queue=0x%08lx\n",(unsigned long)&buf->vb.queue); 671 dprintk(1,"adding vb queue=0x%08lx\n",(unsigned long)&buf->vb.queue);
672 list_add_tail(&buf->vb.queue,&vidq->queued); 672 list_add_tail(&buf->vb.queue,&vidq->queued);
673 buf->vb.state = STATE_QUEUED; 673 buf->vb.state = VIDEOBUF_QUEUED;
674 dprintk(2,"[%p/%d] buffer_queue - append to queued\n", 674 dprintk(2,"[%p/%d] buffer_queue - append to queued\n",
675 buf, buf->vb.i); 675 buf, buf->vb.i);
676 } else if (list_empty(&vidq->active)) { 676 } else if (list_empty(&vidq->active)) {
677 list_add_tail(&buf->vb.queue,&vidq->active); 677 list_add_tail(&buf->vb.queue,&vidq->active);
678 678
679 buf->vb.state = STATE_ACTIVE; 679 buf->vb.state = VIDEOBUF_ACTIVE;
680 mod_timer(&vidq->timeout, jiffies+BUFFER_TIMEOUT); 680 mod_timer(&vidq->timeout, jiffies+BUFFER_TIMEOUT);
681 dprintk(2,"[%p/%d] buffer_queue - first active\n", 681 dprintk(2,"[%p/%d] buffer_queue - first active\n",
682 buf, buf->vb.i); 682 buf, buf->vb.i);
@@ -688,13 +688,13 @@ buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
688 prev->vb.height == buf->vb.height && 688 prev->vb.height == buf->vb.height &&
689 prev->fmt == buf->fmt) { 689 prev->fmt == buf->fmt) {
690 list_add_tail(&buf->vb.queue,&vidq->active); 690 list_add_tail(&buf->vb.queue,&vidq->active);
691 buf->vb.state = STATE_ACTIVE; 691 buf->vb.state = VIDEOBUF_ACTIVE;
692 dprintk(2,"[%p/%d] buffer_queue - append to active\n", 692 dprintk(2,"[%p/%d] buffer_queue - append to active\n",
693 buf, buf->vb.i); 693 buf, buf->vb.i);
694 694
695 } else { 695 } else {
696 list_add_tail(&buf->vb.queue,&vidq->queued); 696 list_add_tail(&buf->vb.queue,&vidq->queued);
697 buf->vb.state = STATE_QUEUED; 697 buf->vb.state = VIDEOBUF_QUEUED;
698 dprintk(2,"[%p/%d] buffer_queue - first queued\n", 698 dprintk(2,"[%p/%d] buffer_queue - first queued\n",
699 buf, buf->vb.i); 699 buf, buf->vb.i);
700 } 700 }
diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h
index 4fd5d0eaa935..567dfe22c07f 100644
--- a/include/media/videobuf-core.h
+++ b/include/media/videobuf-core.h
@@ -56,13 +56,13 @@ struct videobuf_mapping {
56}; 56};
57 57
58enum videobuf_state { 58enum videobuf_state {
59 STATE_NEEDS_INIT = 0, 59 VIDEOBUF_NEEDS_INIT = 0,
60 STATE_PREPARED = 1, 60 VIDEOBUF_PREPARED = 1,
61 STATE_QUEUED = 2, 61 VIDEOBUF_QUEUED = 2,
62 STATE_ACTIVE = 3, 62 VIDEOBUF_ACTIVE = 3,
63 STATE_DONE = 4, 63 VIDEOBUF_DONE = 4,
64 STATE_ERROR = 5, 64 VIDEOBUF_ERROR = 5,
65 STATE_IDLE = 6, 65 VIDEOBUF_IDLE = 6,
66}; 66};
67 67
68struct videobuf_buffer { 68struct videobuf_buffer {