NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Garmin Edge 705 and NetBSD?



On Thu, Apr 29, 2010 at 09:31:17AM -0400, Greg Troxel wrote:
> I suspect Geert's problem is either that we need a special USB driver or
> there's some timing detail that either we get wrong or that garmin
> demands beyond-spec behavior about.  But he would have noticed if linux
> had a special driver...


I had to disable the special linux driver (it's some sort of USB-to-serial
I think, but requires different software than the direct-USB tools I'm now
used to), so it must be similar to NetBSD's ugen(4).

Both gpsbabel and garmintools can *detect* the device correctly btw.  Only
when they start the data transfer, it breaks:

> usb_bulk_write failed. 'error writing to bulk endpoint /dev/ugen1.02:
> Input/output error'

libusb's usb_bulk_write() call is implemented differently on Linux and *BSD
though.  Here's the BSD code.  It fails at the write(3) call with EIO, but
I have no idea how to debug this...

int usb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int size,
                   int timeout)
{
  int fd, ret;

  /* Ensure the endpoint address is correct */
  ep &= ~USB_ENDPOINT_IN;

  fd = ensure_ep_open(dev, ep, O_WRONLY);
  if (fd < 0) {
    if (usb_debug >= 2) {
      fprintf (stderr, "usb_bulk_write: got negative open file descriptor
                for endpoint %02d\n", UE_GET_ADDR(ep));
    }
    return fd;
  }

  ret = ioctl(fd, USB_SET_TIMEOUT, &timeout);
  if (ret < 0)
    USB_ERROR_STR(-errno, "error setting timeout: %s",
                  strerror(errno));

  ret = write(fd, bytes, size);    <======================= errno EIO
  if (ret < 0)
    USB_ERROR_STR(-errno, "error writing to bulk endpoint %s.%02d: %s",
                dev->device->filename, UE_GET_ADDR(ep), strerror(errno));

  return size;
}


        Geert


--
Geert Hendrickx  -=-  ghen%telenet.be@localhost  -=-  PGP: 0xC4BB9E9F
This e-mail was composed using 100% recycled spam messages!

Attachment: pgpz_F2F5hMa4.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index