Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jul 2010 23:40:43 +0200
From:      Peer Stritzinger <peerst@gmail.com>
To:        freebsd-usb@freebsd.org
Subject:   libusb10: libusb_bulk_transfer returns LIBUSB_ERROR_OTHER caused by USB_FS_OPEN ioctl in ugen20_tr_open
Message-ID:  <AANLkTimz1QF1tHA2lPFfoZwP9QKjhr6xHE5oDfJgDHsf@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi,

with the setup from my post of yesterday I'm trying IN transfers with
libusb 1.0 and now I'm a bit stuck.

In essence I'm doing:

=A0=A0cnt =3D libusb_get_device_list(NULL, &list);

  ... find device -> now in found

=A0=A0if (found) {
=A0=A0 =A0libusb_device_handle *handle;
    ...
=A0=A0 =A0rv =3D libusb_open(found, &handle);
    trans_len =3D 0;
    rv =3D libusb_bulk_transfer(handle, ep, buf, NBUF, &trans_len, 0);


What I get is rv -> LIBUSB_ERROR_OTHER to get closer to re reason for
this I debugged the last call into libusb

The error return is caused in ugen20_tr_open():

   ioctl(xfer->pdev->file, USB_FS_OPEN, &temp)

   returns !=3D 0, errno -> EINVAL

Params to this ioctl are:

(gdb) p temp
$1 =3D {max_bufsize =3D 16384, max_frames =3D 1, max_packet_length =3D 0,
  dev_index =3D 0 '\0', ep_index =3D 24 '\030', ep_no =3D 6 '\006'}

(gdb) p *xfer
$2 =3D {pdev =3D 0x282033c0, callback =3D 0x28094190 <libusb10_bulk_intr_pr=
oxy>,
  priv_sc0 =3D 0x282033c0, priv_sc1 =3D 0x28221060, ppBuffer =3D 0x2822208c=
,
  pLength =3D 0x28222088, maxTotalLength =3D 0, maxFrames =3D 1, nFrames =
=3D 0,
  aFrames =3D 0, timeout =3D 0, timeComplete =3D 0, trIndex =3D 24, maxPack=
etLen =3D 0,
  flags =3D 0 '\0', status =3D 0 '\0', is_opened =3D 0 '\0', is_pending =3D=
 0 '\0',
  is_cancel =3D 0 '\0', is_draining =3D 0 '\0', is_restart =3D 0 '\0'}
(gdb) p *xfer->pdev
$3 =3D {ddesc =3D {LIBUSB20_DEVICE_DESC_FORMAT =3D 0x2809abd4, bLength =3D =
18 '\022',
    bDescriptorType =3D 1 '\001', bcdUSB =3D 512, bDeviceClass =3D 0 '\0',
    bDeviceSubClass =3D 0 '\0', bDeviceProtocol =3D 0 '\0',
    bMaxPacketSize0 =3D 64 '@', idVendor =3D 1133, idProduct =3D 49177,
    bcdDevice =3D 0, iManufacturer =3D 1 '\001', iProduct =3D 2 '\002',
    iSerialNumber =3D 0 '\0', bNumConfigurations =3D 1 '\001'}, session_dat=
a =3D {
    session_data =3D 1731721030, tv =3D {tv_sec =3D 1731721030, tv_nsec =3D=
 0},
    plugtime =3D 1731721030}, dev_entry =3D {tqe_next =3D 0x0,
    tqe_prev =3D 0x28202030}, methods =3D 0x2809aac0, beMethods =3D 0x2809a=
a80,
  pTransfer =3D 0x28209c00, privBeData =3D 0x28215300, privLuData =3D 0x282=
07100,
  claimed_interface =3D 0 '\0', file =3D 12, file_ctrl =3D 11, debug =3D 0,
  nTransfer =3D 64, bus_number =3D 3 '\003', device_address =3D 2 '\002',
  usb_mode =3D 0 '\0', usb_speed =3D 3 '\003', is_opened =3D 1 '\001',
  usb_desc =3D "ugen3.2: <CY7C68001 Cypress> at usbus3", '\0' <repeats 57 t=
imes>}

BTW usb_desc is showing the right device.

Any suggestions?

Kind regards,
Peer Stritzinger



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimz1QF1tHA2lPFfoZwP9QKjhr6xHE5oDfJgDHsf>