Re: What about the patch for USB gadgets?



Hi Dan,

On 12/05/11 04:55, Dan Williams wrote:
A quick question on these, are they properly represented in sysfs or are
they "virtual" devices?  Given that they are USB connected it would seem
they should be properly presented, even in the case of platform drivers
since there has to be a USB tree in sysfs to root things in...  One
thing you can do is grab the attached lsudev.c tool and run that like
"lsudev net" when the device is present, and that'll give me more
information about the sysfs layout that I can use to answer my question.

output of "lsudev net" attached.

/devices/platform/at91_ohci/usb1/1-1/1-1:1.0/net/eth1 is a usb ethernet adapter. The device we want to use is usb0.

ifconfig and manual device configuration works:

# ifconfig usb0
usb0      Link encap:Ethernet  HWaddr 46:0d:9e:67:69:ec
          inet addr:10.0.0.40  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: fe80::440d:9eff:fe67:69ec/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:38 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:9245 (9.0 KiB)  TX bytes:468 (468.0 B)



Cheers,

Tom
------------------------------------------------------
Name:     eth1
Type:     (null)
Subsys:   net
Number:   1
Path:     /sys/devices/platform/at91_ohci/usb1/1-1/1-1:1.0/net/eth1
Driver:   (null)
Action:   (null)
Seq Num:  0
Dev File: (null)

Properties:
  UDEV_LOG:                3
  DEVPATH:                 /devices/platform/at91_ohci/usb1/1-1/1-1:1.0/net/eth1
  INTERFACE:               eth1
  IFINDEX:                 3
  SUBSYSTEM:               net
  ID_VENDOR:               Moschip_Semiconductor
  ID_VENDOR_ENC:           Moschip\x20Semiconductor
  ID_VENDOR_ID:            9710
  ID_MODEL:                USB-MAC_Controller
  ID_MODEL_ENC:            USB-MAC\x20Controller\x20\x20\x20
  ID_MODEL_ID:             7830
  ID_REVISION:             0100
  ID_SERIAL:               Moschip_Semiconductor_USB-MAC_Controller_3b00082f
  ID_SERIAL_SHORT:         3b00082f
  ID_TYPE:                 generic
  ID_BUS:                  usb
  ID_USB_INTERFACES:       :ff00ff:
  ID_USB_INTERFACE_NUM:    00
  ID_USB_DRIVER:           MOSCHIP usb-ethernet driver
  ID_VENDOR_FROM_DATABASE: MosChip Semiconductor
  ID_MODEL_FROM_DATABASE:  MCS7830 10/100 Mbps Ethernet adapter
  ID_MM_CANDIDATE:         1

    ------------------------------------------------------
    Name:     1-1:1.0
    Type:     usb_interface
    Subsys:   usb
    Number:   0
    Path:     /sys/devices/platform/at91_ohci/usb1/1-1/1-1:1.0
    Driver:   MOSCHIP usb-ethernet driver
    Action:   (null)
    Seq Num:  0
    Dev File: (null)
    
    Properties:
      UDEV_LOG:  3
      DEVPATH:   /devices/platform/at91_ohci/usb1/1-1/1-1:1.0
      DEVTYPE:   usb_interface
      DRIVER:    MOSCHIP usb-ethernet driver
      PRODUCT:   9710/7830/100
      TYPE:      255/0/255
      INTERFACE: 255/0/255
      MODALIAS:  usb:v9710p7830d0100dcFFdsc00dpFFicFFisc00ipFF
      SUBSYSTEM: usb
    
        ------------------------------------------------------
        Name:     1-1
        Type:     usb_device
        Subsys:   usb
        Number:   1
        Path:     /sys/devices/platform/at91_ohci/usb1/1-1
        Driver:   usb
        Action:   (null)
        Seq Num:  0
        Dev File: /dev/bus/usb/001/003
        
        Properties:
          UDEV_LOG:          3
          DEVPATH:           /devices/platform/at91_ohci/usb1/1-1
          MAJOR:             189
          MINOR:             2
          DEVNAME:           /dev/bus/usb/001/003
          DEVTYPE:           usb_device
          DRIVER:            usb
          PRODUCT:           9710/7830/100
          TYPE:              255/0/255
          BUSNUM:            001
          DEVNUM:            003
          SUBSYSTEM:         usb
          ID_VENDOR:         Moschip_Semiconductor
          ID_VENDOR_ENC:     Moschip\x20Semiconductor
          ID_VENDOR_ID:      9710
          ID_MODEL:          USB-MAC_Controller
          ID_MODEL_ENC:      USB-MAC\x20Controller\x20\x20\x20
          ID_MODEL_ID:       7830
          ID_REVISION:       0100
          ID_SERIAL:         Moschip_Semiconductor_USB-MAC_Controller_3b00082f
          ID_SERIAL_SHORT:   3b00082f
          ID_BUS:            usb
          ID_USB_INTERFACES: :ff00ff:
          DEVLINKS:          /dev/char/189:2
        
            ------------------------------------------------------
            Name:     usb1
            Type:     usb_device
            Subsys:   usb
            Number:   1
            Path:     /sys/devices/platform/at91_ohci/usb1
            Driver:   usb
            Action:   (null)
            Seq Num:  0
            Dev File: /dev/bus/usb/001/001
            
            Properties:
              UDEV_LOG:          3
              DEVPATH:           /devices/platform/at91_ohci/usb1
              MAJOR:             189
              MINOR:             0
              DEVNAME:           /dev/bus/usb/001/001
              DEVTYPE:           usb_device
              DRIVER:            usb
              PRODUCT:           1d6b/1/206
              TYPE:              9/0/0
              BUSNUM:            001
              DEVNUM:            001
              SUBSYSTEM:         usb
              ID_VENDOR:         Linux_2.6.35.3_ohci_hcd
              ID_VENDOR_ENC:     Linux\x202.6.35.3\x20ohci_hcd
              ID_VENDOR_ID:      1d6b
              ID_MODEL:          AT91_OHCI
              ID_MODEL_ENC:      AT91\x20OHCI
              ID_MODEL_ID:       0001
              ID_REVISION:       0206
              ID_SERIAL:         Linux_2.6.35.3_ohci_hcd_AT91_OHCI_at91
              ID_SERIAL_SHORT:   at91
              ID_BUS:            usb
              ID_USB_INTERFACES: :090000:
              DEVLINKS:          /dev/char/189:0
            
                ------------------------------------------------------
                Name:     at91_ohci
                Type:     (null)
                Subsys:   platform
                Number:   (null)
                Path:     /sys/devices/platform/at91_ohci
                Driver:   at91_ohci
                Action:   (null)
                Seq Num:  0
                Dev File: (null)
                
                Properties:
                  UDEV_LOG:  3
                  DEVPATH:   /devices/platform/at91_ohci
                  DRIVER:    at91_ohci
                  MODALIAS:  platform:at91_ohci
                  SUBSYSTEM: platform
                
                    ------------------------------------------------------
                    Name:     platform
                    Type:     (null)
                    Subsys:   (null)
                    Number:   (null)
                    Path:     /sys/devices/platform
                    Driver:   (null)
                    Action:   (null)
                    Seq Num:  0
                    Dev File: (null)
                    
                    Properties:
                      UDEV_LOG: 3
                      DEVPATH:  /devices/platform
                    

------------------------------------------------------
Name:     usb0
Type:     gadget
Subsys:   net
Number:   0
Path:     /sys/devices/platform/at91_udc/gadget/net/usb0
Driver:   (null)
Action:   (null)
Seq Num:  0
Dev File: (null)

Properties:
  UDEV_LOG:        3
  DEVPATH:         /devices/platform/at91_udc/gadget/net/usb0
  DEVTYPE:         gadget
  INTERFACE:       usb0
  IFINDEX:         2
  SUBSYSTEM:       net
  ID_MM_CANDIDATE: 1

    ------------------------------------------------------
    Name:     gadget
    Type:     (null)
    Subsys:   (null)
    Number:   (null)
    Path:     /sys/devices/platform/at91_udc/gadget
    Driver:   (null)
    Action:   (null)
    Seq Num:  0
    Dev File: (null)
    
    Properties:
      UDEV_LOG: 3
      DEVPATH:  /devices/platform/at91_udc/gadget
    
        ------------------------------------------------------
        Name:     at91_udc
        Type:     (null)
        Subsys:   platform
        Number:   (null)
        Path:     /sys/devices/platform/at91_udc
        Driver:   at91_udc
        Action:   (null)
        Seq Num:  0
        Dev File: (null)
        
        Properties:
          UDEV_LOG:  3
          DEVPATH:   /devices/platform/at91_udc
          DRIVER:    at91_udc
          MODALIAS:  platform:at91_udc
          SUBSYSTEM: platform
        
            ------------------------------------------------------
            Name:     platform
            Type:     (null)
            Subsys:   (null)
            Number:   (null)
            Path:     /sys/devices/platform
            Driver:   (null)
            Action:   (null)
            Seq Num:  0
            Dev File: (null)
            
            Properties:
              UDEV_LOG: 3
              DEVPATH:  /devices/platform
            

------------------------------------------------------
Name:     lo
Type:     (null)
Subsys:   net
Number:   (null)
Path:     /sys/devices/virtual/net/lo
Driver:   (null)
Action:   (null)
Seq Num:  0
Dev File: (null)

Properties:
  UDEV_LOG:        3
  DEVPATH:         /devices/virtual/net/lo
  INTERFACE:       lo
  IFINDEX:         1
  SUBSYSTEM:       net
  ID_MM_CANDIDATE: 1




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]