On Sat, 29 Oct 2005, Joshua Wise wrote:
> >> req->zero = (req->actual < req->length);
> > There's no point setting req->zero for an OUT transfer.
> Okay. I have no idea what req->zero actually does. I think I grabbed it from
> zero.c. Does req->zero mean "send a ZLP at the end"?
Pretty much. To be precise, it means "The transfer needs to end with a
short packet, so if the length is an exact multiple of the maxpacket size
and isn't 0, add an extra ZLP at the end."
> >> if (!dev->configured)
> >> return -ENXIO;
> > Whoops! You're still in TASK_INTERRUPTIBLE.
> You are right, I am! That if is gone now, anyway. But, should I be doing
> some signal stuff here, or will schedule() do that for me?
You should; schedule won't do it for you. The idea is that when schedule
returns, you should call signal_pending(current) and return -ERESTARTSYS
if the result isn't 0.
> >> static loff_t null_lseek(struct file * file, loff_t offset, int orig)
> >> {
> >> return file->f_pos = 0;
> >> }
> > Isn't there a standard kernel routine to do this for you?
> Dunno. It's simple enough to have here, anyway.
According to LDD3, you can set the function pointer to no_llseek (defined
in linux/fs.h), and you can even go so far as to call
nonseekable_open(inode, filp) in your open method.
> I uploaded my new version to joshuawise.com/char.c again. Thanks!
You're welcome.
Alan Stern
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel