Dear usb developers,
i'm new in USB driver develop. I'm trying to write a driver for our
fingerprint scanner.
I start from dabusb driver and Linux device driver 2nd Ed demo usb
driver.
The system is able to find the scanner and call the fx2000_probe function
(see code below).
I wrote a inline command for test purpos. Whit this I receive the
error:
ENXIO c0030300, flags 0, urb c1580000, burb c1580000
Where is the problem?
T.I.A.
Giorgio Alboni
static void *fx2000_probe(struct usb_device *udev, unsigned int
ifnum,
const struct usb_device_id *id) { /* * The probe procedure is pretty standard. Device matching has already * been performed based on the id_table structure (defined later) */ struct fx2000_device *scanner; int err; int pipe,maxp; dbg("fx2000: probe: vendor id 0x%x, device id 0x%x
ifnum:%d",
udev->descriptor.idVendor, udev->descriptor.idProduct, ifnum); /* We don't handle multiple configurations */
if (udev->descriptor.bNumConfigurations != 1) return NULL; /* allocate and zero a new data structure for the new device
*/
scanner = kmalloc(sizeof(struct fx2000_device), GFP_KERNEL); printk(KERN_INFO "Fx2000: memory=%i\n",scanner); if (!scanner) return NULL; /* failure */ memset(scanner, 0, sizeof(*scanner)); /* fill the URB data structure using the FILL_INT_URB macro
*/
pipe = usb_sndbulkpipe(udev,6); maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe)); printk(KERN_INFO "Fx2000: maxpacket=%i\n",maxp);
if (maxp > 64) maxp = 64; FILL_BULK_URB(&scanner->sendUrb, udev, pipe,
scanner->pipeOut, maxp, NULL, scanner);
pipe = usb_rcvbulkpipe(udev,5);
FILL_BULK_URB(&scanner->receiveUrb, udev, pipe,
scanner->pipeIn, maxp, NULL, scanner);
// test command to
scanner
scanner->pipeOut[0]=0x00; scanner->pipeOut[1]=0x00; ......... // fill buffer scanner->pipeOut[16]=0x00; scanner->pipeOut[17]=0x00; err=usb_submit_urb
(&scanner->sendUrb);
printk(KERN_INFO "Fx2000: send pipe=%i\n",err); /*err=usb_submit_urb (&scanner->receiveUrb); printk(KERN_INFO "Fx2000: recv pipe=%i\n",err);*/ /* register the URB within the USB subsystem */ if (usb_submit_urb(&scanner->sendUrb)) { kfree(scanner); return NULL; } /* announce yourself */ printk(KERN_INFO "Fx2000: probe successful\n"); /*
* here you might MOD_INC_USE_COUNT; if you do, you'll need to unplug * the device or the devices before being able to unload the module */ /* and return the new structure */
return scanner; } |
- Re: [linux-usb-devel] Fx2000 scanner driver Ing. Giorgio Alboni
- Re: [linux-usb-devel] Fx2000 scanner driver Greg KH
- Re: [linux-usb-devel] Fx2000 scanner driver Ing. Giorgio Alboni
- Re: [linux-usb-devel] Fx2000 scanner driver Ing. Giorgio Alboni