Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 28358
b: refs/heads/master
c: 1fbe75e
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Drake authored and Greg Kroah-Hartman committed Jun 21, 2006
1 parent 02f88cd commit b7dc805
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 955a260829b5848fa90721678bab003234c93356
refs/heads/master: 1fbe75e12f0dd567c86533e13ba2605f3ecad2e1
10 changes: 9 additions & 1 deletion trunk/drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1176,6 +1176,7 @@ static int choose_configuration(struct usb_device *udev)
{
int i;
int num_configs;
int insufficient_power = 0;
struct usb_host_config *c, *best;

best = NULL;
Expand Down Expand Up @@ -1228,8 +1229,10 @@ static int choose_configuration(struct usb_device *udev)
*/

/* Rule out configs that draw too much bus current */
if (c->desc.bMaxPower * 2 > udev->bus_mA)
if (c->desc.bMaxPower * 2 > udev->bus_mA) {
insufficient_power++;
continue;
}

/* If the first config's first interface is COMM/2/0xff
* (MSFT RNDIS), rule it out unless Linux has host-side
Expand Down Expand Up @@ -1263,6 +1266,11 @@ static int choose_configuration(struct usb_device *udev)
best = c;
}

if (insufficient_power > 0)
dev_info(&udev->dev, "rejected %d configuration%s "
"due to insufficient available bus power\n",
insufficient_power, plural(insufficient_power));

if (best) {
i = best->desc.bConfigurationValue;
dev_info(&udev->dev,
Expand Down

0 comments on commit b7dc805

Please sign in to comment.