首页 > 其他分享 >andorid usb网卡名分配过程

andorid usb网卡名分配过程

时间:2024-04-17 09:59:26浏览次数:31  
标签:xhci usb T180 chip 网卡 andorid T33 name

 

 

1、网卡驱动加载log

[  142.122850][ T1830] read descriptors
[  142.127081][ T1830] read strings
[  142.194801][  T180] xhci-hcd xhci-hcd.2.auto: xHCI Host Controller
[  142.203234][  T180] xhci-hcd xhci-hcd.2.auto: new USB bus registered, assigned bus number 2
[  142.215209][  T180] xhci-hcd xhci-hcd.2.auto: hcc params 0x0230fe65 hci version 0x110 quirks 0x0000002000010010
[  142.225788][  T180] xhci-hcd xhci-hcd.2.auto: irq 275, io mem 0x0a600000
[  142.235906][  T180] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10
[  142.245278][  T180] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[  142.253598][  T180] usb usb2: Product: xHCI Host Controller
[  142.259555][  T180] usb usb2: Manufacturer: Linux 5.10.149-qki-consolidate+ xhci-hcd
[  142.267630][  T180] usb usb2: SerialNumber: xhci-hcd.2.auto
[  142.277088][  T180] hub 2-0:1.0: USB hub found
[  142.282055][  T180] hub 2-0:1.0: 1 port detected
[  142.289970][  T180] xhci-hcd xhci-hcd.2.auto: xHCI Host Controller
[  142.292212][  T167] i2c_geni a8c000.i2c: i2c error :-107
[  142.298179][  T180] xhci-hcd xhci-hcd.2.auto: new USB bus registered, assigned bus number 3
[  142.302301][  T167] PM8008: pm8008_read: failed to read 0x0950
[  142.311078][  T180] xhci-hcd xhci-hcd.2.auto: Host supports USB 3.0 SuperSpeed
[  142.317959][  T167] PM8008: _pm8008_chip_is_enabled: qcom,pm8008-chip-en: failed to get chip state rc=-107
[  142.325707][  T180] usb usb3: We don't know the algorithms for LPM for this host, disabling LPM.
[  142.334785][  T167] PM8008: pm8008_chip_probe: Failed to register chip enable regulator rc=-107
[  142.354889][  T180] usb usb3: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.10
[  142.364656][  T180] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[  142.372942][  T180] usb usb3: Product: xHCI Host Controller
[  142.378935][  T180] usb usb3: Manufacturer: Linux 5.10.149-qki-consolidate+ xhci-hcd
[  142.387046][  T180] usb usb3: SerialNumber: xhci-hcd.2.auto
[  142.397574][  T180] hub 3-0:1.0: USB hub found
[  142.402879][  T180] hub 3-0:1.0: 1 port detected
[  142.413466][  T167] i2c_geni a8c000.i2c: i2c error :-107
[  142.419305][  T167] PM8008: pm8008_read: failed to read 0x0950
[  142.425552][  T167] PM8008: _pm8008_chip_is_enabled: qcom,pm8008-chip-en: failed to get chip state rc=-107
[  142.436299][  T167] PM8008: pm8008_chip_probe: Failed to register chip enable regulator rc=-107
[  142.540229][ T1357] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[  143.090481][  T167] (virq:irq_count)- GICv3:IPI(1):144885 GICv3:arch_timer(11):134045 GICv3:IPI(6):55713 GICv3:IPI(2):51356 GICv3:ufshcd(141):35443 ipcc:glink-native-adsp(330):9803 GICv3:ipcc_0(137):9714 GICv3:apps_rsc(132):6943 ipcc:glink-native-modem(346):2238 GICv3:virtio_dev_11(354):2237 
[  143.118348][  T167] (cpu:irq_count)- 0:106796 1:52994 2:54457 3:51558 4:27889 5:26610 6:74306 7:67015 
[  143.128489][  T167] (ipi:irq_count)- 0:144885 1:51356 2:0 3:0 4:0 5:55713 6:0 
[  143.289535][   T33] usb 3-1: new SuperSpeed Gen 1 USB device number 2 using xhci-hcd
[  143.333240][   T33] usb 3-1: New USB device found, idVendor=0bda, idProduct=8156, bcdDevice=31.04
[  143.343024][   T33] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=6
[  143.352141][   T33] usb 3-1: Product: USB 10/100/1G/2.5G LAN
[  143.358409][   T33] usb 3-1: Manufacturer: Realtek
[  143.363717][   T33] usb 3-1: SerialNumber: 401000001
[  143.468414][   T33] 
[  143.468414][   T33] ****usbnet_probe********
[  143.512630][   T33] cdc_ncm 3-1:2.0: MAC-Address: 08:26:ae:38:1d:dd
[  143.519687][   T33] cdc_ncm 3-1:2.0: setting rx_max = 16384
[  143.527874][   T33] cdc_ncm 3-1:2.0: setting tx_max = 16384
[  143.535113][   T33] 
[  143.535113][   T33] ***usbnet_probe***net->name=eth%d******
[  143.577286][   T33] cdc_ncm 3-1:2.0 eth0: register 'cdc_ncm' at usb-xhci-hcd.2.auto-1, CDC NCM, 08:26:ae:38:1d:dd
[  143.590355][  T204] i2c_geni a8c000.i2c: i2c error :-107
[  143.597185][  T204] PM8008: pm8008_read: failed to read 0x0950
[  143.603758][  T204] PM8008: _pm8008_chip_is_enabled: qcom,pm8008-chip-en: failed to get chip state rc=-107
[  143.613847][  T204] PM8008: pm8008_chip_probe: Failed to register chip enable regulator rc=-107
[  143.616747][   T33] cdc_ncm 3-1:2.0 eth0: unregister 'cdc_ncm' usb-xhci-hcd.2.auto-1, CDC NCM
[  143.625415][  T204] i2c_geni a8c000.i2c: i2c error :-107
[  143.637604][  T204] PM8008: pm8008_read: failed to read 0x0950
[  143.644118][  T204] PM8008: _pm8008_chip_is_enabled: qcom,pm8008-chip-en: failed to get chip state rc=-107
[  143.654141][  T204] PM8008: pm8008_chip_probe: Failed to register chip enable regulator rc=-107
[  143.976241][   T33] r8152-cfgselector 3-1: reset SuperSpeed Gen 1 USB device number 2 using xhci-hcd
[  144.423201][   T33] r8152 3-1:1.0 (unnamed net_device) (uninitialized): netif_napi_add() called with weight 256
[  144.480728][   T33] r8152 3-1:1.0 eth0: v2.17.1 (2023/06/13)
[  144.482018][  T250] selinux: SELinux:  Could not stat /sys/devices/platform/soc/a600000.ssusb/a600000.dwc3/xhci-hcd.2.auto/usb3/3-1/wakeup/wakeup53: No such file or directory.
[  144.486920][   T33] r8152 3-1:1.0 eth0: This product is covered by one or more of the following patents:
[  144.486920][   T33]          US6,570,884, US6,115,776, and US6,327,625.
[  144.486920][   T33] 
[  144.493933][  T204] i2c_geni a8c000.i2c: i2c error :-107
[  144.522368][  T250] selinux: 
[  144.527619][  T204] PM8008: pm8008_read: failed to read 0x0950

  

 

2、网名分配调用接口的过程

usbnet_probe--》register_netdev—————》register_netdevice---》dev_get_valid_name--》dev_alloc_name_ns--->__dev_alloc_name

 

static int __dev_alloc_name(struct net *net, const char *name, char *buf)
{
        int i = 0;
        const char *p;
        const int max_netdevices = 8*PAGE_SIZE;
        unsigned long *inuse;
        struct net_device *d;

        if (!dev_valid_name(name))
                return -EINVAL;

        p = strchr(name, '%');
        if (p) {
                /*
                 * Verify the string as this thing may have come from
                 * the user.  There must be either one "%d" and no other "%"
                 * characters.
                 */
                if (p[1] != 'd' || strchr(p + 2, '%'))
                        return -EINVAL;

                /* Use one page as a bit array of possible slots */
                inuse = (unsigned long *) get_zeroed_page(GFP_ATOMIC);
                if (!inuse)
                        return -ENOMEM;

                for_each_netdev(net, d) {
                        struct netdev_name_node *name_node;
                        list_for_each_entry(name_node, &d->name_node->list, list) {
                                if (!sscanf(name_node->name, name, &i))
                                        continue;
                                if (i < 0 || i >= max_netdevices)
                                        continue;

                                /*  avoid cases where sscanf is not exact inverse of printf */
                                snprintf(buf, IFNAMSIZ, name, i);
                                if (!strncmp(buf, name_node->name, IFNAMSIZ))
                                        set_bit(i, inuse);
                        }
                        if (!sscanf(d->name, name, &i))
                                continue;
                        if (i < 0 || i >= max_netdevices)
                                continue;

                        /*  avoid cases where sscanf is not exact inverse of printf */
                        snprintf(buf, IFNAMSIZ, name, i);
                        if (!strncmp(buf, d->name, IFNAMSIZ))
                                set_bit(i, inuse);
                }

                i = find_first_zero_bit(inuse, max_netdevices);
                free_page((unsigned long) inuse);
        }

        snprintf(buf, IFNAMSIZ, name, i);
        if (!__dev_get_by_name(net, buf))
                return i;

        /* It is possible to run out of possible slots
         * when the name is long and there isn't enough space left

  

标签:xhci,usb,T180,chip,网卡,andorid,T33,name
From: https://www.cnblogs.com/yuanqiangfei/p/18139861

相关文章

  • [RoCE] 通过QoS对Mellanox网卡进行限速
    参考资料:QualityofService(QoS)-NVIDIADocs【RDMA】RoCE网络QoS|应用层设置PFC等级|Tos|Priority|TC_cma_roce_tos-CSDN博客【RDMA】mellonx流控配置工具mlnx_qos|PFC-CSDN博客前言目标:我有一个Mellanox-5网卡,我想用RoCE,同时对某些qp进行限速。然而,Mellanox-5网卡在Ro......
  • 揭秘:哪种物联网卡信号好网速快?
    物联卡是一种专门用于物联网设备通信的SIM卡,它能够提供网络连接以支持设备之间的数据传输。在选择物联卡时,信号质量和网速是两个重要的考虑因素。物联卡的信号覆盖直接关系到设备的通信稳定性和数据传输效率。在选择物联卡时,我们需要关注运营商的基站数量、网络覆盖范围以及信号质......
  • wireshark抓包USB
    wireshark抓包USB安装usbmon抓包驱动#加载内核模块usbmonsudomodprobeusbmon#添加用户组usbmonsudoaddgroupusbmon#添加当前用户到组sudogpasswd-a$USERusbmon#写入规则文件sudovi/etc/udev/rules.d/99-usbmon.rulesSUBSYSTEM=="usbmon",GROUP="usbm......
  • UEFI模式下安装Windows系统,您可以使用 Microsoft 提供的 Windows 安装媒体(如 USB 安装
    UEFI模式下安装Windows系统,您可以使用Microsoft提供的Windows安装媒体(如USB安装盘或光盘)。下面是一个简单的批处理脚本示例,用于在UEFI模式下安装Windows系统:CopyCode@echooffclsechoStartingWindowsinstallationinUEFImode...::设置安装媒体的路径,假设为D:......
  • Hyper-V下的Linux虚拟机网卡丢失问题原因及解决办法
    陌上归人的博客-博客园 https://www.cnblogs.com/fjping0606/p/4428495.htmlHyper-V下的Linux虚拟机网卡丢失问题原因及解决办法Hyper-V下的Linux虚拟机网卡丢失问题原因及解决办法 虚拟化大势所趋公司推行了虚拟化,全部用的是MicrosoftWindows2008R2EnterprisewithHyp......
  • SciTech-EE-Mobile-OTG: 切换Host与Device角色由手机USB接口取电为外部设备供电的方法
    SciTech-EE-Mobile-OTG:由手机USB接口取电为外部设备供电的方法OTG接口与转换器OTG是"OnTheGo"的英文缩写,字面上可以理解为“安上即可用”。USB传输是Host-Device的主从结构,一切USB传输都有Host发起:比如:在开发板上插入U盘,这时开发板作为USBHost;但开发板插在PC上,开发板......
  • Ubuntu 18.04无线网卡安装历险记(转)
    问题描述对该问题的解决,耗时数天,曲曲折折。真的可以用“山重水复疑无路”,最后到达了“柳暗花明又一村”。问题环境:Ubuntu18.04,无线网卡为迅捷(Fast)FW150UH(免驱版)。通过系统的网络Wifi设置找不到Adaptor。先是在网上《Ubuntu18.04安装博通(Broadcom)无线网卡驱动》看了相关操......
  • 在linux 创建单分区 BIOS & UEFI双启动的USB启动盘
    简介:还在折腾PXE启动,UEFI的在WDS,一直无法正常启动,也不知道哪里的问题。反正以后还要在WDS上面加多一层引导,前面用的grub4dosgrub4dosuefi。可能是不支持吧,所以折腾一下GRUB2吧。安装linux我习惯使用fedora,现在用的是39的版本。安装包dnfinstallgrub2-commongrub2-pc......
  • CentOS7 虚拟机 ens33网卡失效
    之前虚拟机ssh连接没问题,今天竟然连不上了。打开虚拟机ipa网卡ens33没有iproot@ubuntu:~/Desktop#ipa1:lo:<LOOPBACK,UP,LOWER_UP>mtu65536qdiscnoqueuestateUNKNOWNgroupdefaultqlen1000link/loopback00:00:00:00:00:00brd00:00:00:00:00:00inet1......
  • 重装系统之后,电脑连网卡都没反应怎么办?
    前言有些电脑比较奇葩,安装完成之后会出现网卡连驱动都没有,这时候要安装电脑驱动可是真的烦躁。怎么下手呢?如果确定电脑的网卡型号还好,直接找个电脑下载个对应的网卡驱动,用U盘复制过去就能安装。但如果不知道电脑网卡驱动型号,那可就烦恼了。电脑安装驱动的首要条件就是......