Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Oct 2000 23:08:22 +0200 (CEST)
From:      Torbjorn Kristoffersen <sgt@netcom.no>
To:        hackers@freebsd.org
Subject:   USB webcam driver
Message-ID:  <Pine.BSF.4.21.0010112257140.2631-100000@hal.netforce.no>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0010112257140.2631-100000>