Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Nov 2010 16:26:35 +0100
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        freebsd-usb@freebsd.org
Cc:        Lev Serebryakov <lev@serebryakov.spb.ru>
Subject:   Re: struct usb_config: pass custom parameter to callback?
Message-ID:  <201011121626.35741.hselasky@c2i.net>
In-Reply-To: <1431122664.20101112180144@serebryakov.spb.ru>
References:  <1431122664.20101112180144@serebryakov.spb.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 12 November 2010 16:01:44 Lev Serebryakov wrote:
> Hello, Freebsd-usb.
> 
>   Is it possible to pass custom parameter to xfer callback, configured
> via "struct usb_config"?
> 
>   I'm writing driver for device, which have multiple equivalent ports,
>   each whith its own paor of pipes (for IN and OUT), and I want to use
>   only   two   callbacks.   Is  it  possible? Or should I make N pairs
>   of almost-the-same thunk functions?

Hi,

There is usbd_xfer_get/set_priv() and usbd_xfer_softc() which you can use to 
get and set private and softc alike structure pointers after that the USB 
transfers are setup. Any more custom parameters you need wrap using callback 
wrappers.

--HPS



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