Skip to content

Error fetching ether gadget attributes #102

@pboucherat-thegoodpenguin

Description

The show-gadgets example fails when trying to display an ether gadget's attributes. The example programs e.g. gadget-acm-ecm create the gadgets passing a null attributes pointer, and the ether gadget only creates 4 attributes dev_addr, host_addr, ifname and qmult, whereas in src/function/ether.c there are 7 attributes defined so usbg_f_net_get_attrs() fails when it tries to fetch the fifth one (class_) and returns USBG_ERROR_NOT_FOUND. So after running gadget-acm-ecm, output from show-gadgets looks like this with the not found error where it should be listing the ecm.usb0 attributes :

ID 1d6b:0104 'g1'                                                                                                                                                                                                                                                        
  UDC                   38100000.usb                                                                                                                                                                                                                                     
  bcdUSB                2.01                                                                                                                                                                                                                                             
  bDeviceClass          0x00                                                                                                                                                                                                                                             
  bDeviceSubClass       0x00                                                                                                                                                                                                                                             
  bDeviceProtocol       0x00                                                                                                                                                                                                                                             
  bMaxPacketSize0       64                                                                                                                                                                                                                                               
  idVendor              0x1d6b                                                                                                                                                                                                                                           
  idProduct             0x0104
  bcdDevice             0.01
  Language:     0x409
    Manufacturer        Foo Inc.
    Product             Bar Gadget
    Serial Number       0123456789
  Function, type: acm instance: usb0
    port_num            0
  Function, type: acm instance: usb1
    port_num            1
Error: USBG_ERROR_NOT_FOUND : Not found (file or directory removed)
  Configuration: 'The only one' ID: 1
    MaxPower            2
    bmAttributes        0x80
    Language:   0x409
      configuration     CDC 2xACM+ECM
    acm.GS0 -> acm usb0
    acm.GS1 -> acm usb1
    ecm.usb0 -> ecm usb0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions