什麼是USB 裝置檔案系統 (USB Device File System):

USB 裝置檔案系統是一個虛擬的檔案系統,其目的是讓使用者能夠查詢到USB BUS上所有裝置的相關資訊
當USB Device System被掛載後,它會在掛載的目錄下出現一個devices的檔案
該檔案會列舉出所有連接到USB Bus上所有裝置,與其詳細的內容(如裝置類別, 組態設定, 介面, 設定, 端點...等相關資訊)
   

開啟核心的USB Device File System支援:

   make menuconfig
   Device Drivers  --->
            [*] USB support  --->
                *** Miscellaneous USB options ***                                                              
                [*]     USB device filesystem (DEPRECATED)

掛載USB Device File System


   mount -t usbfs none /proc/bus/usb

查詢USB Bus上所有裝置的資訊:

   cat /proc/bus/usb/devices
       

執行範例:
          
    #cat /proc/bus/usb/devices
         
    T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
    B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
    D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
    P:  Vendor=0000 ProdID=0000 Rev= 2.06
    S:  Product=OHCI Host Controller
    S:  SerialNumber=ohci_hcd
    C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  0mA
    I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
    E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms
   
    *************************************************************************
    this device is a USB 1.1 OHCI Host Controller and it has only one interface and one configuration
    Speed: 12 Mbps
      Interface 0 has 1 alternate setting                       // driver : N/A
        for setting 0: there is one Interrupt endpoint exost   
    
     //---------------------------------------------------------------------
    T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 2
    B:  Alloc=  2/800 us ( 0%), #Int=  2, #Iso=  0
    D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS= 8 #Cfgs=  1
    P:  Vendor=0000 ProdID=0000 Rev= 2.06
    S:  Product=EHCI Host Controller
    S:  SerialNumber=ehci_hcd
    C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  0mA
    I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
    E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=256ms
   
    *************************************************************************
    this device is a USB 2.0 Host Controller and it has only one interface and one configuration
    Speed: 480 Mbps
   
      Interface 0 has 1 alternate setting                       // driver : N/A
        for setting 0: there is one Interrupt endpoint exost
               
    
    //---------------------------------------------------------------------
    T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=480 MxCh= 4
    D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
    P:  Vendor=05e3 ProdID=0608 Rev=77.61
    S:  Product=USB2.0 Hub
    C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
    I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
    E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=256ms
   
    *************************************************************************
    this device is a USB 2.0 HUB and it has only one interface and one configuration
    Speed: 480 Mbps
      Interface 0 has 1 alternate setting                       // driver : N/A
        for setting 0: there is one Interrupt endpoint exost
                
     //---------------------------------------------------------------------
    T:  Bus=01 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#=  3 Spd=480 MxCh= 0
    D:  Ver= 2.00 Cls=ef(unk. ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
    P:  Vendor=0408 ProdID=1030 Rev=21.14
    S:  Product=QCV103
    S:  SerialNumber=1802A
    C:* #Ifs= 3 Cfg#= 1 Atr=80 MxPwr=100mA
    I:  If#= 0 Alt= 0 #EPs= 1 Cls=0e(unk. ) Sub=01 Prot=00 Driver=uvcvideo
      E:  Ad=81(I) Atr=03(Int.) MxPS=  32 Ivl=4ms
     
    I:  If#= 1 Alt= 0 #EPs= 0 Cls=0e(unk. ) Sub=02 Prot=00 Driver=uvcvideo
    I:  If#= 1 Alt= 1 #EPs= 1 Cls=0e(unk. ) Sub=02 Prot=00 Driver=uvcvideo   
      E:  Ad=82(I) Atr=05(Isoc) MxPS=3072 Ivl=125us
    I:  If#= 1 Alt= 2 #EPs= 1 Cls=0e(unk. ) Sub=02 Prot=00 Driver=uvcvideo
      E:    Ad=82(I) Atr=05(Isoc) MxPS=2280 Ivl=125us
    I:  If#= 1 Alt= 3 #EPs= 1 Cls=0e(unk. ) Sub=02 Prot=00 Driver=uvcvideo
      E:  Ad=82(I) Atr=05(Isoc) MxPS=1024 Ivl=125us
    I:  If#= 1 Alt= 4 #EPs= 1 Cls=0e(unk. ) Sub=02 Prot=00 Driver=uvcvideo
      E:  Ad=82(I) Atr=05(Isoc) MxPS= 512 Ivl=125us
    I:  If#= 2 Alt= 0 #EPs= 0 Cls=0e(unk. ) Sub=02 Prot=00 Driver=(none)
    I:  If#= 2 Alt= 1 #EPs= 1 Cls=0e(unk. ) Sub=02 Prot=00 Driver=(none)
      E:  Ad=83(I) Atr=05(Isoc) MxPS= 792 Ivl=125us
   
   
    I:  If#= 2 Alt= 2 #EPs= 1 Cls=0e(unk. ) Sub=02 Prot=00 Driver=(none)
      E:  Ad=83(I) Atr=05(Isoc) MxPS= 256 Ivl=125us
   
    *************************************************************************
    this device has 3 Interface and 1 configutation
   
      Interface 0 has 1 alternate setting                       // driver : uvc video
        for setting 0: there is one Interrupt endpoint exost
     
      Interface 1 has 2 alternate settings                       // driver : uvc video
        for setting 0: there is no any endpoint                 
        for setting 1: there is one Isochronous endpoint exist.
        for setting 2: there is one Isochronous endpoint exist.   
        for setting 3: there is one Isochronous endpoint exist.   
        for setting 4: there is one Isochronous endpoint exist.   
        for setting 5: there is one Isochronous endpoint exist.               
       
      Interface 3 has 2 alternate settings
        for setting 0: there is no any endpoint
        for setting 1: there is one Isochronous endpoint exist.
    
    
     //---------------------------------------------------------------------
    T:  Bus=01 Lev=02 Prnt=02 Port=03 Cnt=02 Dev#=  4 Spd=12  MxCh= 0
    D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=16 #Cfgs=  1
    P:  Vendor=0d8c ProdID=0130 Rev= 1.00
    S:  Product=USB PnP Audio Device
    C:* #Ifs= 3 Cfg#= 1 Atr=80 MxPwr=100mA
    I:  If#= 0 Alt= 0 #EPs= 0 Cls=01(audio) Sub=01 Prot=00 Driver=(none)
    I:  If#= 1 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=00 Driver=(none)
    I:  If#= 1 Alt= 1 #EPs= 1 Cls=01(audio) Sub=02 Prot=00 Driver=(none)
    E:  Ad=82(I) Atr=05(Isoc) MxPS= 200 Ivl=1ms
    I:  If#= 2 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=(none)
    E:  Ad=87(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
   
    *************************************************************************
    this device has 3 Interface and 1 configutation
   
      Interface 0 is a audio class device and it has 1 alternate setting,                          
        for setting 0: there is no Interrupt endpoint exist
     
      Interface 1 is a audio class device and it has 2 alternate settings,                          
        for setting 0: there is no any endpoint                 
        for setting 1: there is one Isochronous endpoint exist.
       
      Interface 2 is a Human Interface device (HID) and it has 1 alternate setting
        for setting 0: there is one Interrupt endpoint

   

arrow
arrow
    全站熱搜

    kaivy2001 發表在 痞客邦 留言(0) 人氣()