USB error: no configuration chosen from 1 choice

来源:互联网 发布:飓风打印软件 编辑:程序博客网 时间:2024/06/07 03:34

前段时间使用wifi模块时, 由于设备连接HUB, 在加载驱动过程中提示信息如下:

usbcore: registered new interface driver rtl8188eu
usb x-y.z: New USB device found, idVendor=0bda, idProduct=8179
usb x-y.z: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb x-y.z: Product: 802.11n NIC
usb x-y.z: Manufacturer: Realtek
usb x-y.z: SerialNumber: 00E04C0001
usb x-y.z: rejected 1 configuration due to insufficient available bus power
usb x-y.z: no configuration chosen from 1 choice


提示相应的功耗不足, 导致无法找到wifi模块对应的设备.


没办法, 先找解决办法:

方法一(治标不治本, 可暂时先解决眼前问题)

使用shell命令强制提高电流到500mA

echo -n 1 > /sys/bus/usb/devices/x-y.z/bConfigurationValue

x y z对应usb设备的编号


方法二

跟根源上解决, 找到当前系统对应的内核源码

既然设备练到HUB上, 那电流应该是由hub分配的, 在kernel/driver/usb/core中找到hub.c

在hub_configure中可以发现

else if ((hubstatus & (1 << USB_DEVICE_SELF_POWERED)) == 0) { 
        dev_dbg(hub_dev, "hub controller current requirement: %dmA\n",
            hub->descriptor->bHubContrCurrent);
        hub->limited_power = 1; 
        if (hdev->maxchild > 0) { 
            int remaining = hdev->bus_mA -
                    hub->descriptor->bHubContrCurrent;


            if (remaining < hdev->maxchild * 100) 
                dev_warn(hub_dev,
                    "insufficient power available "
                    "to use all downstream ports\n");
            hub->mA_per_port = 100;       /* 7.2.1.1 */
        }    
    } 

设备被设置为100mA, 只需将其设置为500mA即可

hub->mA_per_port = 500;

再重新编译内核, 完毕

0 0
原创粉丝点击