Lines 1171-1176
static int choose_configuration(struct u
Link Here
|
1171 |
u16 devstatus; |
1171 |
u16 devstatus; |
1172 |
int bus_powered; |
1172 |
int bus_powered; |
1173 |
int num_configs; |
1173 |
int num_configs; |
|
|
1174 |
int insufficient_power = 0; |
1174 |
struct usb_host_config *c, *best; |
1175 |
struct usb_host_config *c, *best; |
1175 |
|
1176 |
|
1176 |
/* If this fails, assume the device is bus-powered */ |
1177 |
/* If this fails, assume the device is bus-powered */ |
Lines 1218-1225
static int choose_configuration(struct u
Link Here
|
1218 |
*/ |
1219 |
*/ |
1219 |
|
1220 |
|
1220 |
/* Rule out configs that draw too much bus current */ |
1221 |
/* Rule out configs that draw too much bus current */ |
1221 |
if (c->desc.bMaxPower * 2 > udev->bus_mA) |
1222 |
if (c->desc.bMaxPower * 2 > udev->bus_mA) { |
|
|
1223 |
insufficient_power++; |
1222 |
continue; |
1224 |
continue; |
|
|
1225 |
} |
1223 |
|
1226 |
|
1224 |
/* If the first config's first interface is COMM/2/0xff |
1227 |
/* If the first config's first interface is COMM/2/0xff |
1225 |
* (MSFT RNDIS), rule it out unless Linux has host-side |
1228 |
* (MSFT RNDIS), rule it out unless Linux has host-side |
Lines 1263-1268
static int choose_configuration(struct u
Link Here
|
1263 |
dev_warn(&udev->dev, |
1266 |
dev_warn(&udev->dev, |
1264 |
"no configuration chosen from %d choice%s\n", |
1267 |
"no configuration chosen from %d choice%s\n", |
1265 |
num_configs, plural(num_configs)); |
1268 |
num_configs, plural(num_configs)); |
|
|
1269 |
if (insufficient_power > 0) |
1270 |
dev_info(&udev->dev, "%d configuration%s rejected " |
1271 |
"due to insufficient available bus power\n", |
1272 |
insufficient_power, plural(insufficient_power)); |
1266 |
} |
1273 |
} |
1267 |
return i; |
1274 |
return i; |
1268 |
} |
1275 |
} |