Thanks Alan On Fri, Jul 8, 2011 at 2:15 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote: > On Fri, 8 Jul 2011, Subodh Raiborde wrote: > >> Hi, >> >> I need to reduce the max power that can be drawn by any USB device to 250 mA. >> I want to do this from the host end (linux). >> >> From what I understand the USB configuration is provided by the USB >> device attached to the >> host and the host reads the bMaxPower from it and if the bMaxPower >> requested is below requested particular limit (say 500 mA) >> then the device is allowed to receive the requested power. I want to >> change that limit to 250mA so that no device can draw more than that. >> >> Please let me know the best way to do this. > > In drivers/usb/core/hub.c:hub_configure(), find these lines: > > if (hdev == hdev->bus->root_hub) { > if (hdev->bus_mA == 0 || hdev->bus_mA >= 500) > hub->mA_per_port = 500; > > ... > > } else { /* Self-powered external hub */ > /* FIXME: What about battery-powered external hubs that > * provide less current per port? */ > hub->mA_per_port = 500; > } > > and change the 500 values to 250. > > Alan Stern > > -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html