Mon Feb 2 20:39:46 2009 UTC ()
Pull up following revision(s) (requested by jmcneill in ticket #382):
	sys/dev/usb/uvideo.c: revision 1.26
When setting up isochronous transfers, fix a typo in an out-of-memory test.


(snj)
diff -r1.21.10.3 -r1.21.10.4 src/sys/dev/usb/uvideo.c

cvs diff -r1.21.10.3 -r1.21.10.4 src/sys/dev/usb/uvideo.c (expand / switch to unified diff)

--- src/sys/dev/usb/uvideo.c 2008/12/27 03:47:55 1.21.10.3
+++ src/sys/dev/usb/uvideo.c 2009/02/02 20:39:46 1.21.10.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: uvideo.c,v 1.21.10.3 2008/12/27 03:47:55 snj Exp $ */ 1/* $NetBSD: uvideo.c,v 1.21.10.4 2009/02/02 20:39:46 snj Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2008 Patrick Mahoney 4 * Copyright (c) 2008 Patrick Mahoney
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code was written by Patrick Mahoney (pat@polycrystal.org) as 7 * This code was written by Patrick Mahoney (pat@polycrystal.org) as
8 * part of Google Summer of Code 2008. 8 * part of Google Summer of Code 2008.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -32,27 +32,27 @@ @@ -32,27 +32,27 @@
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE. 36 * POSSIBILITY OF SUCH DAMAGE.
37 */ 37 */
38 38
39/* 39/*
40 * USB video specs: 40 * USB video specs:
41 * http://www.usb.org/developers/devclass_docs/USB_Video_Class_1_1.zip 41 * http://www.usb.org/developers/devclass_docs/USB_Video_Class_1_1.zip
42 */ 42 */
43 43
44#include <sys/cdefs.h> 44#include <sys/cdefs.h>
45__KERNEL_RCSID(0, "$NetBSD: uvideo.c,v 1.21.10.3 2008/12/27 03:47:55 snj Exp $"); 45__KERNEL_RCSID(0, "$NetBSD: uvideo.c,v 1.21.10.4 2009/02/02 20:39:46 snj Exp $");
46 46
47#ifdef _MODULE 47#ifdef _MODULE
48#include <sys/module.h> 48#include <sys/module.h>
49#endif 49#endif
50 50
51#include <sys/param.h> 51#include <sys/param.h>
52#include <sys/systm.h> 52#include <sys/systm.h>
53#include <sys/kernel.h> 53#include <sys/kernel.h>
54/* #include <sys/malloc.h> */ 54/* #include <sys/malloc.h> */
55#include <sys/kmem.h> 55#include <sys/kmem.h>
56#include <sys/device.h> 56#include <sys/device.h>
57#include <sys/ioctl.h> 57#include <sys/ioctl.h>
58#include <sys/uio.h> 58#include <sys/uio.h>
@@ -1598,27 +1598,27 @@ uvideo_stream_start_xfer(struct uvideo_s @@ -1598,27 +1598,27 @@ uvideo_stream_start_xfer(struct uvideo_s
1598 for (i = 0; i < UVIDEO_NXFERS; i++) { 1598 for (i = 0; i < UVIDEO_NXFERS; i++) {
1599 struct uvideo_isoc *isoc = &ix->ix_i[i]; 1599 struct uvideo_isoc *isoc = &ix->ix_i[i];
1600 isoc->i_xfer = usbd_alloc_xfer(sc->sc_udev); 1600 isoc->i_xfer = usbd_alloc_xfer(sc->sc_udev);
1601 if (isoc->i_xfer == NULL) { 1601 if (isoc->i_xfer == NULL) {
1602 DPRINTF(("uvideo: failed to alloc xfer: %s" 1602 DPRINTF(("uvideo: failed to alloc xfer: %s"
1603 " (%d)\n", 1603 " (%d)\n",
1604 usbd_errstr(err), err)); 1604 usbd_errstr(err), err));
1605 return ENOMEM; 1605 return ENOMEM;
1606 } 1606 }
1607 1607
1608 isoc->i_buf = usbd_alloc_buffer(isoc->i_xfer, 1608 isoc->i_buf = usbd_alloc_buffer(isoc->i_xfer,
1609 nframes * uframe_len); 1609 nframes * uframe_len);
1610 1610
1611 if (isoc->i_xfer == NULL) { 1611 if (isoc->i_buf == NULL) {
1612 DPRINTF(("uvideo: failed to alloc buf: %s" 1612 DPRINTF(("uvideo: failed to alloc buf: %s"
1613 " (%d)\n", 1613 " (%d)\n",
1614 usbd_errstr(err), err)); 1614 usbd_errstr(err), err));
1615 return ENOMEM; 1615 return ENOMEM;
1616 } 1616 }
1617 } 1617 }
1618 1618
1619 uvideo_stream_recv_isoc_start(vs); 1619 uvideo_stream_recv_isoc_start(vs);
1620 1620
1621 return 0; 1621 return 0;
1622 default: 1622 default:
1623 /* should never get here */ 1623 /* should never get here */
1624 DPRINTF(("uvideo_stream_start_xfer: unknown xfer type 0x%x\n", 1624 DPRINTF(("uvideo_stream_start_xfer: unknown xfer type 0x%x\n",