> > int auerchain_unlink_urb(struct auerchain *acp, struct urb *urb) > > + spin_unlock_irqrestore(&acp->lock, flags); > > + dbg("unlink waiting urb"); > > + urb->status = -ENOENT; > > + urb->complete(urb); > > Please no. Don't do this. > > > > I am afraid there are severe layering violations in this code. > > Can you explain? What do you mean? What should I do instead?
If you feel you need to emulate functionality the core should have, the core should have that functionality. So go hence and expand the core :-) For anything but usbcore to mess with the internals of an URB is unacceptable. But in your case I am not so sure about the need. It seems to me that you need an approach with a little more abstraction. Something like: struct chain_head { struct device_descriptor *dc; struct chain_element *first; } struct chain_element { struct chain_element *next; struct chain_head *chain; struct urb *urb; } void complete_chain_element (struct urb *u) { struct chain_element *ce = (struct chain_element *)u->context; if (u->status) { error_in_chain(ce); } else { if (ce->next) submit_chain_element(ce->next); else chain_done(ce->chain); } } Just to give you an idea. Regards Oliver ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel