Date: Fri, 27 May 2005 13:31:04 +0200 From: Seb <sebastien.b@swissinfo.org> To: hselasky@c2i.net Cc: freebsd-usb@freebsd.org Subject: Re: usbd_bulk_transfer returns 1 (USBD_IN_PROGRESS) ?! Message-ID: <200505271331.05132.sebastien.b@swissinfo.org> In-Reply-To: <200505261925.38744.hselasky@c2i.net> References: <200505252120.22408.sebastien.b@swissinfo.org> <200505261421.53060.sebastien.b@swissinfo.org> <200505261925.38744.hselasky@c2i.net>
index | next in thread | previous in thread | raw e-mail
Ok, I understood the problem. But I didn't fix it with mutexes, I used semaphores instead. I initialize a semaphore with a value equal to 1 and then, before the USB transfers, I do : mtx_unlock(&Giant); sema_wait(&sc->usb_tx_sema); mtx_lock(&Giant); And after the USB transfers : sema_post(&sc->usb_tx_sema); Is this OK ? Apparently it has solved the problem, the driver now sustains heavy network load :) I wouln't like to use asynchronous transfers, they make the code hard to read and would require all users to recompile their kernels to install your USB driver... Regards, Sebastienhome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200505271331.05132.sebastien.b>
