Hello,

I noticed that FreeBSD driver[0] is based on OpenBSD implementation so I
tried  on  FreeBSD-16.0-CURRENT and  everything  works  fine there  (the
network interface `ue0` can be configured):

  usb_alloc_device: set address 5 failed (USB_ERR_IOERROR, ignored)
  usbd_setup_device_desc: getting device descriptor at addr 5 failed, 
USB_ERR_TIMEOUT
  usbd_req_re_enumerate: addr=5, set address failed! (USB_ERR_IOERROR, ignored)
  usbd_setup_device_desc: getting device descriptor at addr 5 failed, 
USB_ERR_IOERROR
  ugen0.5: <Unisoc Unisoc Phone> at usbus0
  ugen0.5: <Unisoc Unisoc Phone> at usbus0 (disconnected)
  ugen0.5: <Unisoc Unisoc Phone> at usbus0
  urndis0 on uhub1
  urndis0: <Unisoc Unisoc Phone, class 0/0, rev 2.00/0.01, addr 5> on usbus0
  ue0: <USB Ethernet> on urndis0
  ue0: Ethernet address: d2:36:db:4f:f6:8a

I'm currently  reading OpenBSD driver  source code and trying  to figure
out  what's  wrong  but as  I'm  new  to  both  OpenBSD and  USB  driver
programming,  any hint  or help  to debug  this issue  would be  greatly
appreciated. Thanks in advance!

Regards,
Arnaud

[0] https://cgit.freebsd.org/src/tree/sys/dev/usb/net/if_urndis.c

P.S.: In case it could be useful, here is more information on the device
from FreeBSD `usbconfig`:

  ugen0.5: <Unisoc Phone Spreadtrum Communications Inc.> at usbus0, cfg=0 
md=HOST spd=HIGH (480Mbps) pwr=ON (100mA)

  bLength = 0x0012 
  bDescriptorType = 0x0001 
  bcdUSB = 0x0200 
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000 
  bDeviceProtocol = 0x0000 
  bMaxPacketSize0 = 0x0040 
  idVendor = 0x1782 
  idProduct = 0x000c 
  bcdDevice = 0x0001 
  iManufacturer = 0x0001  <Unisoc>
  iProduct = 0x0002  <Unisoc Phone>
  iSerialNumber = 0x0003  <Unisoc Phone>
  bNumConfigurations = 0x0001 

 Configuration index 0

    bLength = 0x0009 
    bDescriptorType = 0x0002 
    wTotalLength = 0x0079 
    bNumInterfaces = 0x0004 
    bConfigurationValue = 0x0001 
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x00c0 
    bMaxPower = 0x0032 

    Additional Descriptor

    bLength = 0x08
    bDescriptorType = 0x0b
    bDescriptorSubType = 0x00
     RAW dump: 
     0x00 | 0x08, 0x0b, 0x00, 0x02, 0xe0, 0x01, 0x03, 0x00


    Additional Descriptor

    bLength = 0x05
    bDescriptorType = 0x24
    bDescriptorSubType = 0x00
     RAW dump: 
     0x00 | 0x05, 0x24, 0x00, 0x10, 0x01


    Additional Descriptor

    bLength = 0x05
    bDescriptorType = 0x24
    bDescriptorSubType = 0x01
     RAW dump: 
     0x00 | 0x05, 0x24, 0x01, 0x00, 0x01


    Additional Descriptor

    bLength = 0x04
    bDescriptorType = 0x24
    bDescriptorSubType = 0x02
     RAW dump: 
     0x00 | 0x04, 0x24, 0x02, 0x00


    Additional Descriptor

    bLength = 0x05
    bDescriptorType = 0x24
    bDescriptorSubType = 0x06
     RAW dump: 
     0x00 | 0x05, 0x24, 0x06, 0x00, 0x01


    Interface 0
      bLength = 0x0009 
      bDescriptorType = 0x0004 
      bInterfaceNumber = 0x0000 
      bAlternateSetting = 0x0000 
      bNumEndpoints = 0x0001 
      bInterfaceClass = 0x0002  <Communication device>
      bInterfaceSubClass = 0x0002 
      bInterfaceProtocol = 0x00ff 
      iInterface = 0x0000  <no string>

     Endpoint 0
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0089  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0200 
        bInterval = 0x0001 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 


    Interface 1
      bLength = 0x0009 
      bDescriptorType = 0x0004 
      bInterfaceNumber = 0x0001 
      bAlternateSetting = 0x0000 
      bNumEndpoints = 0x0002 
      bInterfaceClass = 0x000a  <CDC-data>
      bInterfaceSubClass = 0x0000 
      bInterfaceProtocol = 0x0000 
      iInterface = 0x0000  <no string>

     Endpoint 0
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x008b  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

     Endpoint 1
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x000a  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 


    Interface 2
      bLength = 0x0009 
      bDescriptorType = 0x0004 
      bInterfaceNumber = 0x0002 
      bAlternateSetting = 0x0000 
      bNumEndpoints = 0x0002 
      bInterfaceClass = 0x00ff  <Vendor specific>
      bInterfaceSubClass = 0x0000 
      bInterfaceProtocol = 0x0000 
      iInterface = 0x0000  <no string>

     Endpoint 0
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0081  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

     Endpoint 1
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0002  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 


    Interface 3
      bLength = 0x0009 
      bDescriptorType = 0x0004 
      bInterfaceNumber = 0x0003 
      bAlternateSetting = 0x0000 
      bNumEndpoints = 0x0002 
      bInterfaceClass = 0x00ff  <Vendor specific>
      bInterfaceSubClass = 0x0000 
      bInterfaceProtocol = 0x0000 
      iInterface = 0x0000  <no string>

     Endpoint 0
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0083  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

     Endpoint 1
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0004  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

Reply via email to