Index: current/cdl/usbs_serial.cdl =================================================================== --- current/cdl/usbs_serial.cdl 12 Jul 2008 10:30:34 -0000 1.1 +++ current/cdl/usbs_serial.cdl 21 Oct 2008 15:29:19 -0000 @@ -191,6 +191,31 @@ is first plugged into the host." } + cdl_option CYGBLD_IO_USB_SLAVE_SERIAL_BUSPOWERED { + display "The Device is bus powered" + default_value 0 + flavor bool + description " + Tells the driver whether the Device is a bus powered + device or a self powered device." + } + cdl_option CYGNUM_IO_USB_SLAVE_SERIAL_CURRENTDRAW { + display "Maximum current (in mA) drawn from USB bus" + flavor data + default_value 100 + legal_values 1 to 500 + requires ((CYGNUM_IO_USB_SLAVE_SERIAL_CURRENTDRAW > 100) implies CYGBLD_IO_USB_SLAVE_SERIAL_BUSPOWERED) + description " + The maximum current drawn by the Device from the USB bus. + It should report the peak value. A self powered device + can draw up to 100mA, a bus powered device can draw up to + 500mA. (If it is sometimes below 100mA and sometimes over, + then a tranition could be done at runtime between self and + bus powered modes, but that would be complicated and the + device would have to return from configured to addressed + state. For details, see the USB specification.)" + } + cdl_option CYGBLD_IO_USB_SLAVE_SERIAL_DEBUG { display "Enable debug output from the driver" default_value 0 Index: current/src/usbs_serial.c =================================================================== --- current/src/usbs_serial.c 12 Jul 2008 10:30:34 -0000 1.1 +++ current/src/usbs_serial.c 21 Oct 2008 15:19:00 -0000 @@ -126,9 +126,13 @@ number_interfaces: USBS_SERIAL_NUM_IFACE, configuration_id: 1, configuration_str: 0, +#ifdef CYGBLD_IO_USB_SLAVE_SERIAL_BUSPOWERED + attributes: (USB_CONFIGURATION_DESCRIPTOR_ATTR_REQUIRED), +#else attributes: (USB_CONFIGURATION_DESCRIPTOR_ATTR_REQUIRED | USB_CONFIGURATION_DESCRIPTOR_ATTR_SELF_POWERED), - max_power: 50 +#endif + max_power: (CYGNUM_IO_USB_SLAVE_SERIAL_CURRENTDRAW+1)/2 //round up }; // ----- Interface Descriptor -----