Date: Mon, 30 Aug 2010 21:13:33 +0200 From: Hans Petter Selasky <hselasky@c2i.net> To: freebsd-usb@freebsd.org Subject: Re: USB synchronous control transfers (for usb-to-serial) Message-ID: <201008302113.33960.hselasky@c2i.net> In-Reply-To: <AANLkTikAnF_OqNDjCBdJcXRXrvLC9XdqHyR4b3pS68X6@mail.gmail.com> References: <AANLkTinr3KbWOqgQoKVvF84H2c02fHh9SQRDeUkSRn4B@mail.gmail.com> <AANLkTikAnF_OqNDjCBdJcXRXrvLC9XdqHyR4b3pS68X6@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 30 August 2010 14:41:56 Piet Skiet wrote: > On Mon, Aug 30, 2010 at 10:51 AM, Piet Skiet <tuksgig@gmail.com> wrote: > > Hi, > > > > Can anyone clarify how to go about doing a synchronous usb control > > transfer, similar to Linux's usb_control_msg? I want to implement the > > TIOCMGET ioctl on a usb-to-serial converter. The Linux driver uses > > synchronous control messages to read DCE and CTS serial pin status, > > and I want to do something similar in FreeBSD. The usbdi(9) manpage > > talks about control transfers using usbd_transfer_submit, but they're > > not synchronous. What about using usbd_transfer_drain? Is there an > > example driver showing setting up and doing control transfers? > > > > The ucom driver seems to only implement TIOCSBRK and TIOCCBRK iotcls > > at the moment. > > > > Thanks > > Scanning through the ucom code, it seems to me that the > usbd_do_request_proc has somehting to do with blocking control transfers. > Am I on the right track here? Yes, this is correct. You have to re-format the do request information a little bit compared with Linux. This function is supposed to be called from a UCOM callback. Please also check recent changes in USB P4: http://p4web.freebsd.org/@md=d&cd=//depot/projects/usb/src/sys/dev/usb/controller/&cdf=//depot/projects/usb/src/sys/dev/usb/serial/usb_serial.c&c=LJN@//depot/projects/usb/src/sys/dev/usb/serial/usb_serial.c?ac=22 --HPS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008302113.33960.hselasky>