From owner-freebsd-hackers Wed Oct 11 14: 8: 1 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from link.mirror.org (link.mirror.org [216.38.7.35]) by hub.freebsd.org (Postfix) with ESMTP id 97AF637B66C for ; Wed, 11 Oct 2000 14:07:58 -0700 (PDT) Received: from hal (52-d10-1.svg1.netcom.no [212.45.182.245]) by link.mirror.org (8.7.5/8.7.3) with ESMTP id RAA12944 for ; Wed, 11 Oct 2000 17:34:31 -0400 Date: Wed, 11 Oct 2000 23:08:22 +0200 (CEST) From: Torbjorn Kristoffersen X-Sender: sgt@hal.netforce.no To: hackers@freebsd.org Subject: USB webcam driver Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, I found information from the vendor of my webcamera, it's CPiA based. I've hacked together a userland driver program that simply opens an ugen device, verifies that it's the right camera, and prints vendorId/productNo. Next it attempts to read from the camera using an reg_read(fd, reg) function (What I want to read at first is "GetCPIAVersion", some version info). reg_read() is supposed to get data using the usb_ctl_request structure. This is how I use it: struct usb_ctl_request ur; unsigned char data[1024]; ur.request.bmRequestType = UT_READ_VENDOR_INTERFACE; ur.request.bRequest = 1; // // i got these numbers USETW(ur.request.wValve, 0); // from the vendor's info USETW(ur.request.wIndex, 0); // about GetCPIAVersion USETW(ur.request.wLength, 4); // ur.data = data; ur.flags = 0; ur.actlen = 0; Then attempting an ioctl call with ioctl(fd, USB_DO_REQUEST, &ur) fails with "Input/output error"... This is probably simple, but I can't figure out why this happens. Thanks in advance Torbjorn Kristoffersen To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message