Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 04 Aug 2006 09:39:09 +0200
From:      Rene Ladan <r.c.ladan@gmail.com>
To:        Konrad.Jankowski@master.ether.net
Cc:        libusb-devel@lists.sourceforge.net, freebsd-usb@freebsd.org
Subject:   Re: [Libusb-devel] [PATCH] FreeBSD fix for usb_control_msg()
Message-ID:  <44D2F99D.80306@gmail.com>
In-Reply-To: <200608031759.k73Hxi40002311@master.ether.net>
References:  <200608031759.k73Hxi40002311@master.ether.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Konrad.Jankowski@master.ether.net schreef:
> I don't know how Net- or Open- handle this, but
> FreeBSD returns the number of transmited bytes in
> req.ucr_actlen, not in req.ucr_request.wLength.
> (/usr/include/dev/usb/usb.h:544:
>         int     ucr_actlen;             /* actual length transferred */
> 
> So then:
> --- bsd.c       Sat Mar  4 03:52:46 2006
> +++ ../../bsd.c Thu Aug  3 19:19:15 2006
> @@ -476,8 +476,11 @@
>    if (ret < 0)
>      USB_ERROR_STR(-errno, "error sending control message: %s",
>                    strerror(errno));
> -
> +#ifdef __FreeBSD_kernel__
> +  return req.ucr_actlen;
> +#else
>    return UGETW(req.ucr_request.wLength);
> +#endif
>  }
>  
>  int usb_os_find_busses(struct usb_bus **busses)
>
This seems correct, wLength is a uWord defined in usb_device_request_t
(usb/usb.h:112).
usb_device_request_t is included in usb_ctl_request (usb/usb.h:542),
which is the structure in which ucr_actlen (int) is defined (usb/usb.h:546)

I am cc'ing freebsd-usb@ since  I'm not sure about this patch...

Regards,
Rene
-- 
GPG fingerprint = E738 5471 D185 7013 0EE0  4FC8 3C1D 6F83 12E1 84F6
(subkeys.pgp.net)

"It won't fit on the line."
		-- me, 2001




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