From owner-freebsd-usb@FreeBSD.ORG Sun Jul 8 00:25:21 2007 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DA6CD16A421 for ; Sun, 8 Jul 2007 00:25:21 +0000 (UTC) (envelope-from xiaofanc@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.183]) by mx1.freebsd.org (Postfix) with ESMTP id B2F5F13C447 for ; Sun, 8 Jul 2007 00:25:21 +0000 (UTC) (envelope-from xiaofanc@gmail.com) Received: by wa-out-1112.google.com with SMTP id j37so806923waf for ; Sat, 07 Jul 2007 17:25:20 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Y+TXA9KY3CfcLH0wKt0fnlVwOIgnlNIv7IrMD5K8AWKWF9ToQwvTfUBlRfKR5Pg+5RpfT2DUn+0QnFxYBrextwZoSjmG3bQIVE4XVsvrJ2l9Ywr0IZEvTjuabDw7uO3xbI9LcpxRIXj9jn3J2M9SSPyxRu2lipwzF9LR77uAn+s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Clg0eYLetF2+Fo5VznfedVfRgF4SL8SWMrtvuqRoLycng8y1cKjA25G3WgtrsnsxaESXo8JXztqBHojrxKZtYea4wmEYBPsQePAJZtUW85Q9en0ChdmD0gVxIesaI75GZ5LWPenOTSNxQcE1PgHx4em8yow8TMK39WDZQ/FvV6s= Received: by 10.114.254.1 with SMTP id b1mr1866503wai.1183854320788; Sat, 07 Jul 2007 17:25:20 -0700 (PDT) Received: by 10.114.176.17 with HTTP; Sat, 7 Jul 2007 17:25:20 -0700 (PDT) Message-ID: Date: Sat, 7 Jul 2007 20:25:20 -0400 From: "Xiaofan Chen" To: "Hans Petter Selasky" In-Reply-To: <200707051724.30175.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200707051724.30175.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: libusb usb_interrupt_read hangs under FreeBSD X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jul 2007 00:25:21 -0000 On 7/5/07, Hans Petter Selasky wrote: > > > > The chip does not handle a clear-stall request on the control pipe to > > > > clear-stall on the interrupt pipe. The result is that the interrupt > > > > pipe stops, or at least all buffers are cleared. > > > > The following is part of the usb firmware from Micrcohip. Somehow it masks EP0 in the handler to SET & CLEAR FEATURES requesrs. Is this the problem? if((SetupPkt.bFeature == ENDPOINT_HALT)&& (SetupPkt.Recipient == RCPT_EP)&& (SetupPkt.EPNum != 0)) /****************************************************************************** * Function: void USBStdFeatureReqHandler(void) * * PreCondition: None * * Input: None * * Output: None * * Side Effects: None * * Overview: This routine handles the standard SET & CLEAR FEATURES * requests * * Note: None *****************************************************************************/ void USBStdFeatureReqHandler(void) { if((SetupPkt.bFeature == DEVICE_REMOTE_WAKEUP)&& (SetupPkt.Recipient == RCPT_DEV)) { ctrl_trf_session_owner = MUID_USB9; if(SetupPkt.bRequest == SET_FEATURE) usb_stat.RemoteWakeup = 1; else usb_stat.RemoteWakeup = 0; }//end if if((SetupPkt.bFeature == ENDPOINT_HALT)&& (SetupPkt.Recipient == RCPT_EP)&& (SetupPkt.EPNum != 0)) { ctrl_trf_session_owner = MUID_USB9; /* Must do address calculation here */ pDst.bRam = (byte*)&ep0Bo+(SetupPkt.EPNum*8)+(SetupPkt.EPDir*4); if(SetupPkt.bRequest == SET_FEATURE) *pDst.bRam = _USIE|_BSTALL; else { if(SetupPkt.EPDir == 1) // IN *pDst.bRam = _UCPU; else *pDst.bRam = _USIE|_DAT0|_DTSEN; }//end if }//end if }//end USBStdFeatureReqHandler Regards, Xiaofan