From owner-freebsd-hackers@FreeBSD.ORG Mon May 3 13:49:30 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 663D316A4CE for ; Mon, 3 May 2004 13:49:30 -0700 (PDT) Received: from sccrmhc11.comcast.net (sccrmhc11.comcast.net [204.127.202.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id F264143D45 for ; Mon, 3 May 2004 13:49:29 -0700 (PDT) (envelope-from ritalin@comcast.net) Received: from emachine (pcp04418869pcs.nrockv01.md.comcast.net[69.140.111.25]) by comcast.net (sccrmhc11) with SMTP id <2004050320491801100jkrske>; Mon, 3 May 2004 20:49:23 +0000 Message-ID: <008901c4314e$72b214e0$9402a8c0@emachine> From: "Rita Lin" To: References: <004c01c43053$2a775920$9402a8c0@emachine> <20040503120824.GG38488@cicely12.cicely.de> Date: Mon, 3 May 2004 16:37:22 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 cc: freebsd-hackers@freebsd.org Subject: Re: USB device driver question: timeout() and usbd_do_request() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 May 2004 20:49:30 -0000 > But I don't understand the whole issue you have. > Just schedule a request and wait for the device to ack. > The Host controller does the polling for you as long as the request is > queued and the timeout value supplied with the request did not time out. > That has nothing to do with FreeBSD - it's how things work with USB in > general. I needed a "task" or a timer that periodicaly polls the modem status from the USB device. I think you meant the timeout value inside the usbd_do_request(). I needed something that periodically calls usbd_do_request(). The mention of FreeBSD device polling was something I found on the Web. The FreeBSD allows network driver to do polling instead of interrupt. The implementation requires the first interrupt from the device in order to register the callback for the polling. When I first saw the device polling support in FreeBSD, I thought I could call usbd_do_request() in the callback routine. I was wrong. Mike Silbersack suggested the use of kthread. I added it today, tested it out, and it works. Thanks, Mike! By the way, for people who are writing USB drivers that uses ucom support, you do not need to modify ucom.c to support multiple ports. By doing a trick in declaring xxx_softc, I was able to create 4 ucom ports with one single physical device. Rita > > -- > B.Walter BWCT http://www.bwct.de > bernd@bwct.de info@bwct.de >