On Fri, Feb 28, 2003 at 02:46:45PM -0800, David Brownell wrote:
>
> +/* the chapter 9 device states */
> +
> +enum usb_device_state {
> + USB_STATE_ATTACHED = 0, /* "only" attached */
> + USB_STATE_POWERED,
> + USB_STATE_DEFAULT, /* limited function */
> + USB_STATE_ADDRESS,
> + USB_STATE_CONFIGURED, /* most functions */
> + USB_STATE_SUSPENDED
> +};
Hm, if you read Table 9-1, the states can not be represented as a enum,
but need to be a bitmask (you can be attached, powered, and suspended at
the same time.) We've lived until now without these states, what does
it buy us to add them now?
> + /* mark the device as inactive, so any further urb submissions for
> + * this device will fail. "attached" is the initial state for usb,
> + * it includes "not attached" (no device signaling).
> + */
> + dev->state = USB_STATE_ATTACHED;
> +
No, that's just crazy. We can't say the device is attached, as it is
plainly gone from the system. Either make a new state, or just live
without the state issues, and leave the present flag. Don't overload
the attached state for two different meanings.
thanks,
greg k-h
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger
for complex code. Debugging C/C++ programs can leave you feeling lost and
disoriented. TotalView can help you find your way. Available on major UNIX
and Linux platforms. Try it free. www.etnus.com
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel