From owner-freebsd-usb@FreeBSD.ORG Mon Feb 2 01:06:29 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2621E68E; Mon, 2 Feb 2015 01:06:29 +0000 (UTC) Received: from smtp.mei.co.jp (smtp.mei.co.jp [133.183.100.20]) by mx1.freebsd.org (Postfix) with ESMTP id A37A7E54; Mon, 2 Feb 2015 01:06:28 +0000 (UTC) Received: from mail-gw.jp.panasonic.com ([157.8.1.157]) by smtp.mei.co.jp (8.12.11.20060614/3.7W/kc-maile12) with ESMTP id t1216BSF015712; Mon, 2 Feb 2015 10:06:11 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili15) with ESMTP id t1216BB24801; Mon, 2 Feb 2015 10:06:11 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi13) id t1216BHD003632; Mon, 2 Feb 2015 10:06:11 +0900 Received: from localhost by lomi13.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id t1216BST003607; Mon, 2 Feb 2015 10:06:11 +0900 Date: Mon, 02 Feb 2015 10:06:11 +0900 (JST) Message-Id: <20150202.100611.2049338919815112954.okuno.kohji@jp.panasonic.com> To: hps@selasky.org Subject: Re: [Bug?] Control Transfers in xHCI From: Kohji Okuno In-Reply-To: <54CA9144.4030601@selasky.org> References: <54CA4BE3.2090706@selasky.org> <20150129195714.GA3683@dchagin.static.corbina.net> <54CA9144.4030601@selasky.org> Organization: Panasonic Corporation X-Mailer: Mew version 6.6 on Emacs 24.4 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2015 01:06:29 -0000 From: Hans Petter Selasky Subject: Re: [Bug?] Control Transfers in xHCI Date: Thu, 29 Jan 2015 21:00:04 +0100 > On 01/29/15 20:57, Chagin Dmitry wrote: >> On Thu, Jan 29, 2015 at 04:04:03PM +0100, Hans Petter Selasky wrote: >>> On 01/29/15 13:25, Kohji Okuno wrote: >>>> Hi HPS, >>>> >>>> I found a bug in xHCI device driver. >>>> >>>> Acording to extensible-host-controler-interface-usb-xhci.pdf:"3.2.9 >>>> Control Transfers"... >>>> >>>> A Data Stage TD consists of a Data Stage TRB followed by zero or more >>>> Normal TRBs. If the data is not physically contiguous, Normal TRBs may >>>> be chained to the Data Stage TRB. >>>> >>>> >>>> But, in the current imprementation, when two or more TRBs are needed, >>>> the device driver set XHCI_TRB_TYPE_DATA_STAGE to all TRBs. >>>> This is the violation of the spec. >>>> >>>> In my minor xHCI, I encountered strange bubble error in a control >>>> transfer. After I changed as the following, I succeeded its control >>>> transfer. >>>> >>>> Would you check the following (****)? >>>> >>> >>> Hi Kohji, >>> >>> You are correct there is a bug, but your patch is not correct. >>> >>> In FreeBSD we allow SETUP and DATA stages to be done as separate jobs. >>> That means at the entry of creating a new DATA chain, we need to check >>> if it is there first DATA packet or not. >>> >>> Can you test the attached patch and see if it works for you? >>> >> patch is lost somewhere, Hans. >> > > Trying again. > > I think Kohji got it. Hi HPS, usbd_control_transfer_did_data() has a bug, I think. I got the following error. And, the kernel failed to detect a device. usbd_setup_device_desc: getting device descriptor at addr 1 failed, USB_ERR_TIM\ EOUT In this time, the values for judgement were `xfer->flags_int.control_rem = 0' and `UGETW(req.wLength) = 18' Best regards, Kohji Okuno From owner-freebsd-usb@FreeBSD.ORG Mon Feb 2 07:51:58 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5E435D4B; Mon, 2 Feb 2015 07:51:58 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0AB7C2C; Mon, 2 Feb 2015 07:51:57 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id DCDE11FE023; Mon, 2 Feb 2015 08:51:54 +0100 (CET) Message-ID: <54CF2CCE.9090101@selasky.org> Date: Mon, 02 Feb 2015 08:52:46 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Kohji Okuno Subject: Re: [Bug?] Control Transfers in xHCI References: <54CA4BE3.2090706@selasky.org> <20150129195714.GA3683@dchagin.static.corbina.net> <54CA9144.4030601@selasky.org> <20150202.100611.2049338919815112954.okuno.kohji@jp.panasonic.com> In-Reply-To: <20150202.100611.2049338919815112954.okuno.kohji@jp.panasonic.com> Content-Type: multipart/mixed; boundary="------------000306000605080001060004" Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2015 07:51:58 -0000 This is a multi-part message in MIME format. --------------000306000605080001060004 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Hi, Please find updated patch. The control_rem is pre-decremented and not post-decremented. --HPS --------------000306000605080001060004 Content-Type: text/x-patch; name="xhci.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xhci.patch" Index: sys/dev/usb/controller/xhci.c =================================================================== --- sys/dev/usb/controller/xhci.c (revision 277724) +++ sys/dev/usb/controller/xhci.c (working copy) @@ -1866,6 +1866,15 @@ XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_DATA_STAGE); if (temp->direction == UE_DIR_IN) dword |= XHCI_TRB_3_DIR_IN | XHCI_TRB_3_ISP_BIT; + /* + * Section 3.2.9 in the XHCI + * specification about control + * transfers says that we should use a + * normal-TRB if there are more TRBs + * extending the data-stage + * TRB. Update the "trb_type". + */ + temp->trb_type = XHCI_TRB_TYPE_NORMAL; break; case XHCI_TRB_TYPE_STATUS_STAGE: dword = XHCI_TRB_3_CHAIN_BIT | XHCI_TRB_3_CYCLE_BIT | @@ -2106,7 +2115,8 @@ mult = 1; temp.isoc_delta = 0; temp.isoc_frame = 0; - temp.trb_type = XHCI_TRB_TYPE_DATA_STAGE; + temp.trb_type = xfer->flags_int.control_did_data ? + XHCI_TRB_TYPE_NORMAL : XHCI_TRB_TYPE_DATA_STAGE; } else { x = 0; mult = 1; Index: sys/dev/usb/usb_core.h =================================================================== --- sys/dev/usb/usb_core.h (revision 277724) +++ sys/dev/usb/usb_core.h (working copy) @@ -101,6 +101,7 @@ * sent */ uint8_t control_act:1; /* set if control transfer is active */ uint8_t control_stall:1; /* set if control transfer should be stalled */ + uint8_t control_did_data:1; /* set if control data has been sent */ uint8_t short_frames_ok:1; /* filtered version */ uint8_t short_xfer_ok:1; /* filtered version */ Index: sys/dev/usb/usb_transfer.c =================================================================== --- sys/dev/usb/usb_transfer.c (revision 277724) +++ sys/dev/usb/usb_transfer.c (working copy) @@ -1409,6 +1409,28 @@ } /*------------------------------------------------------------------------* + * usbd_control_transfer_did_data + * + * This function returns non-zero if a control endpoint has done the + * first DATA packet after the SETUP packet. Else it returns zero. + *------------------------------------------------------------------------*/ +static uint8_t +usbd_control_transfer_did_data(struct usb_xfer *xfer) +{ + struct usb_device_request req; + + /* SETUP packet is not yet sent */ + if (xfer->flags_int.control_hdr != 0) + return (0); + + /* copy out the USB request header */ + usbd_copy_out(xfer->frbuffers, 0, &req, sizeof(req)); + + /* compare remainder to the initial value */ + return (xfer->flags_int.control_rem != UGETW(req.wLength)); +} + +/*------------------------------------------------------------------------* * usbd_setup_ctrl_transfer * * This function handles initialisation of control transfers. Control @@ -1513,6 +1535,11 @@ len = (xfer->sumlen - sizeof(struct usb_device_request)); } + /* update did data flag */ + + xfer->flags_int.control_did_data = + usbd_control_transfer_did_data(xfer); + /* check if there is a length mismatch */ if (len > xfer->flags_int.control_rem) { --------------000306000605080001060004-- From owner-freebsd-usb@FreeBSD.ORG Mon Feb 2 10:20:16 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BBD37D90; Mon, 2 Feb 2015 10:20:16 +0000 (UTC) Received: from smtp.mei.co.jp (smtp.mei.co.jp [133.183.100.20]) by mx1.freebsd.org (Postfix) with ESMTP id 60AD5CAD; Mon, 2 Feb 2015 10:20:15 +0000 (UTC) Received: from mail-gw.jp.panasonic.com ([157.8.1.157]) by smtp.mei.co.jp (8.12.11.20060614/3.7W/kc-maile13) with ESMTP id t12AK8QP000864; Mon, 2 Feb 2015 19:20:08 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili12) with ESMTP id t12AK8o18168; Mon, 2 Feb 2015 19:20:08 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi15) id t12AK82I003987; Mon, 2 Feb 2015 19:20:08 +0900 Received: from localhost by lomi15.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id t12AK8i8003966; Mon, 2 Feb 2015 19:20:08 +0900 Date: Mon, 02 Feb 2015 19:20:07 +0900 (JST) Message-Id: <20150202.192007.950724363311591508.okuno.kohji@jp.panasonic.com> To: hps@selasky.org Subject: Re: [Bug?] Control Transfers in xHCI From: Kohji Okuno In-Reply-To: <54CF2CCE.9090101@selasky.org> References: <54CA9144.4030601@selasky.org> <20150202.100611.2049338919815112954.okuno.kohji@jp.panasonic.com> <54CF2CCE.9090101@selasky.org> Organization: Panasonic Corporation X-Mailer: Mew version 6.6 on Emacs 24.4 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2015 10:20:16 -0000 From: Hans Petter Selasky Subject: Re: [Bug?] Control Transfers in xHCI Date: Mon, 02 Feb 2015 08:52:46 +0100 > Hi, > > Please find updated patch. The control_rem is pre-decremented and not > post-decremented. > > --HPS Hi HPS, This patch seems good in my environment. Many thanks, Kohji Okuno From owner-freebsd-usb@FreeBSD.ORG Mon Feb 2 11:07:40 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EBD066A0; Mon, 2 Feb 2015 11:07:40 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA5A71FE; Mon, 2 Feb 2015 11:07:40 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 387E91FE023; Mon, 2 Feb 2015 12:07:38 +0100 (CET) Message-ID: <54CF5AAE.8070705@selasky.org> Date: Mon, 02 Feb 2015 12:08:30 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Kohji Okuno Subject: Re: [Bug?] Control Transfers in xHCI References: <54CA9144.4030601@selasky.org> <20150202.100611.2049338919815112954.okuno.kohji@jp.panasonic.com> <54CF2CCE.9090101@selasky.org> <20150202.192007.950724363311591508.okuno.kohji@jp.panasonic.com> In-Reply-To: <20150202.192007.950724363311591508.okuno.kohji@jp.panasonic.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2015 11:07:41 -0000 On 02/02/15 11:20, Kohji Okuno wrote: > From: Hans Petter Selasky > Subject: Re: [Bug?] Control Transfers in xHCI > Date: Mon, 02 Feb 2015 08:52:46 +0100 >> Hi, >> >> Please find updated patch. The control_rem is pre-decremented and not >> post-decremented. >> >> --HPS Here you go: https://svnweb.freebsd.org/changeset/base/278071 Thanks for your bug report! --HPS From owner-freebsd-usb@FreeBSD.ORG Mon Feb 2 11:33:56 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1C253B1; Mon, 2 Feb 2015 11:33:56 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96AC77A8; Mon, 2 Feb 2015 11:33:56 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 7BD1B1FE023; Mon, 2 Feb 2015 12:33:53 +0100 (CET) Message-ID: <54CF60D5.5040407@selasky.org> Date: Mon, 02 Feb 2015 12:34:45 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Ian Lepore Subject: Re: usb_pc_cpu_flush References: <1419359192795-5975583.post@n5.nabble.com> <5499E734.1070507@selasky.org> <1419392511197-5975691.post@n5.nabble.com> <549A811D.3060204@selasky.org> <1419416870924-5975752.post@n5.nabble.com> <1419423740820-5975763.post@n5.nabble.com> <549AB711.8070005@selasky.org> <1419431704871-5975773.post@n5.nabble.com> <549BF430.8000207@selasky.org> <1419877515606-5976832.post@n5.nabble.com> <1421133295061-5980199.post@n5.nabble.com> <1421160576.14601.175.camel@freebsd.org> <54B53956.4090708@selasky.org> <1421163656.14601.184.camel@freebsd.org> <54B54073.6000409@selasky.org> <1421166591.14601.195.camel@freebsd.org> <54B54D4D.3010805@selasky.org> <1421180700.14601.209.camel@freebsd.org> <54B5FAE8.7020705@selasky.org> <1421247832.14601.258.camel@freebsd.org> <54B689E0.7040005@selasky.org> In-Reply-To: <54B689E0.7040005@selasky.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: kott , freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2015 11:33:57 -0000 Hi Ian, Any news on this issue? I've put the following patch into -current for your convenience: https://svnweb.freebsd.org/changeset/base/278074 Kohji: Maybe you also want to test and review this patch? --HPS From owner-freebsd-usb@FreeBSD.ORG Mon Feb 2 18:21:10 2015 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AAE52626 for ; Mon, 2 Feb 2015 18:21:10 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91B43D02 for ; Mon, 2 Feb 2015 18:21:10 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t12ILAiF004558 for ; Mon, 2 Feb 2015 18:21:10 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-usb@FreeBSD.org Subject: [Bug 185747] [cam] [patch] fix support for USB key "Kingston DT 101 G2" Date: Mon, 02 Feb 2015 18:21:10 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: commit-hook@freebsd.org X-Bugzilla-Status: In Progress X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: freebsd-usb@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2015 18:21:10 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=185747 --- Comment #12 from commit-hook@freebsd.org --- A commit references this bug: Author: hselasky Date: Mon Feb 2 18:20:11 UTC 2015 New revision: 278105 URL: https://svnweb.freebsd.org/changeset/base/278105 Log: Separate out detection of prevent and allow medium removal quirk. PR: 185747 MFC after: 1 week Changes: head/sys/dev/usb/usb_msctest.c -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-usb@FreeBSD.ORG Tue Feb 3 23:50:07 2015 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A711E8E1 for ; Tue, 3 Feb 2015 23:50:07 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D4BE14C for ; Tue, 3 Feb 2015 23:50:07 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t13No7fs027146 for ; Tue, 3 Feb 2015 23:50:07 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-usb@FreeBSD.org Subject: [Bug 156596] [ehci] Extremely high interrupt rate on ehci/uhci IRQ16 80% cpu utilization on CPU0 Date: Tue, 03 Feb 2015 23:50:07 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: 8.2-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: steven_nikkel@ertyu.org X-Bugzilla-Status: In Progress X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: freebsd-usb@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Feb 2015 23:50:07 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=156596 steven_nikkel@ertyu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |steven_nikkel@ertyu.org --- Comment #15 from steven_nikkel@ertyu.org --- Seeing the same thing on 10.1-RELEASE-p5 with a Gigabyte GA-C1037UN (Intel NM70 Chipset). Problem started after I unplugged a VGA monitor. -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-usb@FreeBSD.ORG Wed Feb 4 01:52:25 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A7F5A4A; Wed, 4 Feb 2015 01:52:25 +0000 (UTC) Received: from mail-ie0-x233.google.com (mail-ie0-x233.google.com [IPv6:2607:f8b0:4001:c03::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C900BFF3; Wed, 4 Feb 2015 01:52:24 +0000 (UTC) Received: by mail-ie0-f179.google.com with SMTP id x19so29813248ier.10; Tue, 03 Feb 2015 17:52:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=dK000Tx6isyOdcKvAyP88VDCDjJb83FleROVg4t+X7o=; b=eeG/n4ltP0GD0OIgRJ0/LskqPX1s/8Vs61wZLHmPUltrHA2ROtz8KqpimiodvN0Y+C mOTzrdoXS4pdkWWtp3VdpeZb8s8thAOxsqIHnYIx2HxoRGRI7NbR1n04NdXHRREN/M56 AbOyV2zt+e5RFxo4SStrSuaZhuHNPoBAbPrW76cyk2EPM27I6z8iGrB7GDdy3QAUe6Rs NWKgKjMefRKJbV6S61D3ovUBrfkPf2Riog9pGXFUM1PYY2mmLVo+TYorFwCmFUtMD1rd WED1QRS9Clhe9zwQjcg2ET0l2Gu8I+TAfcmcnCsaWkfgQ6KMfzm6FygYDci8PYOcNGJ2 kmKA== MIME-Version: 1.0 X-Received: by 10.42.201.78 with SMTP id ez14mr27215930icb.22.1423014743871; Tue, 03 Feb 2015 17:52:23 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.17.7 with HTTP; Tue, 3 Feb 2015 17:52:23 -0800 (PST) Date: Tue, 3 Feb 2015 17:52:23 -0800 X-Google-Sender-Auth: 6bJevBcYYbCwnBkAZ6edfYX_dZQ Message-ID: Subject: uhci interrupts keep firing.. From: Adrian Chadd To: Hans Petter Selasky , "freebsd-usb@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2015 01:52:25 -0000 Hi Hans (and others); As requested from IRC the next time this happened: Feb 3 17:51:33 lucy-11i386 kernel: uhci_interrupt: real interrupt Feb 3 17:51:33 lucy-11i386 kernel: uhci_dumpregs: usbus4 regs: cmd=0080, sts=0020, intr=000f, frnum=04f1, flbase=0107e3c4, sof=0040, portsc1=0080, portsc2=0080 Feb 3 17:51:33 lucy-11i386 kernel: uhci_interrupt: uhci_interrupt: host controller halted Feb 3 17:51:33 lucy-11i386 kernel: uhci_dumpregs: usbus4 regs: cmd=0080, sts=0020, intr=000f, frnum=04f1, flbase=0107e3c4, sof=0040, portsc1=0080, portsc2=0080 Feb 3 17:51:33 lucy-11i386 kernel: uhci_dump_qh: QH(0xc75bc580) at 0x025bc582: h_next=0x025bc502 e_next=0x00000001 Feb 3 17:51:33 lucy-11i386 kernel: uhci_dump_qh: QH(0xc75bc500) at 0x025bc502: h_next=0x025bc482 e_next=0x00000001 Feb 3 17:51:33 lucy-11i386 kernel: uhci_dump_qh: QH(0xc75bc480) at 0x025bc482: h_next=0x025bc402 e_next=0x00000001 Feb 3 17:51:33 lucy-11i386 kernel: uhci_dump_qh: QH(0xc75bc400) at 0x025bc402: h_next=0x00000001 e_next=0x025bc380 Feb 3 17:51:33 lucy-11i386 kernel: uhci_interrupt: real interrupt Feb 3 17:51:33 lucy-11i386 kernel: uhci_dumpregs: usbus4 regs: cmd=0080, sts=0020, intr=000f, frnum=04f1, flbase=0107e3c4, sof=0040, portsc1=0080, portsc2=0080 Feb 3 17:51:33 lucy-11i386 kernel: uhci_interrupt: uhci_interrupt: host controller halted Feb 3 17:51:33 lucy-11i386 kernel: uhci_dumpregs: usbus4 regs: cmd=0080, sts=0020, intr=000f, frnum=04f1, flbase=0107e3c4, sof=0040, portsc1=0080, portsc2=0080 Feb 3 17:51:33 lucy-11i386 kernel: uhci_dump_qh: QH(0xc75bc580) at 0x025bc582: h_next=0x025bc502 e_next=0x00000001 Feb 3 17:51:33 lucy-11i386 kernel: uhci_dump_qh: QH(0xc75bc500) at 0x025bc502: h_next=0x025bc482 e_next=0x00000001 Feb 3 17:51:33 lucy-11i386 kernel: uhci_dump_qh: QH(0xc75bc480) at 0x025bc482: h_next=0x025bc402 e_next=0x00000001 Feb 3 17:51:33 lucy-11i386 kernel: uhci_interrupt: real interrupt Feb 3 17:51:33 lucy-11i386 kernel: uhci_dumpregs: usbus0 regs: cmd=0080, sts=0020, intr=000f, frnum=01de, flbase=01045778, sof=0040, portsc1=0080, portsc2=0080 Feb 3 17:51:33 lucy-11i386 kernel: uhci_interrupt: uhci_interrupt: host controller halted Feb 3 17:51:33 lucy-11i386 kernel: uhci_dumpregs: usbus0 regs: cmd=0080, sts=0020, intr=000f, frnum=01de, flbase=01045778, sof=0040, portsc1=0080, portsc2=0080 Feb 3 17:51:33 lucy-11i386 kernel: uhci_dump_qh: QH(0xc751d300) at 0x0251d302: h_next=0x0251d282 e_next=0x00000001 Feb 3 17:51:33 lucy-11i386 kernel: uhci_dump_qh: QH(0xc751d280) at 0x0251d282: h_next=0x0251d202 e_next=0x00000001 Feb 3 17:51:33 lucy-11i386 kernel: uhci_dump_qh: QH(0xc751d200) at 0x0251d202: h_next=0x0251d182 e_next=0x00000001 Feb 3 17:51:33 lucy-11i386 kernel: uhci_dump_qh: QH(0xc751d180) at 0x0251d182: h_next=0x00000001 e_next=0x0251d100 Feb 3 17:51:33 lucy-11i386 kernel: uhci_dump_qh: QH(0xc75bc400) at 0x025bc402: h_next=0x00000001 e_next=0x025bc380 Feb 3 17:51:33 lucy-11i386 kernel: uhci_interrupt: real interrupt Feb 3 17:51:33 lucy-11i386 kernel: uhci_dumpregs: usbus4 regs: cmd=0080, sts=0020, intr=000f, frnum=04f1, flbase=0107e3c4, sof=0040, portsc1=0080, portsc2=0080 Feb 3 17:51:33 lucy-11i386 kernel: uhci_interrupt: uhci_interrupt: host controller halted Feb 3 17:51:33 lucy-11i386 kernel: uhci_dumpregs: usbus4 regs: cmd=0080, sts=0020, intr=000f, frnum=04f1, flbase=0107e3c4, sof=0040, portsc1=0080, portsc2=0080 Feb 3 17:51:33 lucy-11i386 kernel: uhci_dump_qh: QH(0xc75bc580) at 0x025bc582: h_next=0x025bc502 e_next=0x00000001 Feb 3 17:51:33 lucy-11i386 kernel: uhci_dump_qh: QH(0xc75bc500) at 0x025bc502: h_next=0x025bc482 e_next=0x00000001 Feb 3 17:51:33 lucy-11i386 kernel: uhci_dump_qh: QH(0xc75bc480) at 0x025bc482: h_next=0x025bc402 e_next=0x00000001 Feb 3 17:51:33 lucy-11i386 kernel: uhci_dump_qh: QH(0xc75bc400) at 0x025bc402: h_next=0x00000001 e_next=0x025bc380 From owner-freebsd-usb@FreeBSD.ORG Wed Feb 4 07:36:13 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF717A4E; Wed, 4 Feb 2015 07:36:13 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DDF8882; Wed, 4 Feb 2015 07:36:13 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 666261FE023; Wed, 4 Feb 2015 08:35:44 +0100 (CET) Message-ID: <54D1CBEA.1040306@selasky.org> Date: Wed, 04 Feb 2015 08:36:10 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Adrian Chadd , "freebsd-usb@freebsd.org" Subject: Re: uhci interrupts keep firing.. References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2015 07:36:13 -0000 On 02/04/15 02:52, Adrian Chadd wrote: > Hi Hans (and others); > > As requested from IRC the next time this happened: Hi Adrian, Your UHCI has halted and it doesn't stop firing interrupts! Can you try the attached patch? When does this happen and does it happen with EHCI or OHCI? --HPS From owner-freebsd-usb@FreeBSD.ORG Thu Feb 5 08:17:43 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A40B5FF0 for ; Thu, 5 Feb 2015 08:17:43 +0000 (UTC) Received: from pzwet.vanderzwet.net (pzwet.vanderzwet.net [IPv6:2a01:4f8:190:8221::1:1]) by mx1.freebsd.org (Postfix) with ESMTP id 328A32EF for ; Thu, 5 Feb 2015 08:17:42 +0000 (UTC) Received: from [192.168.178.55] (5ED2ABEE.cm-7-3c.dynamic.ziggo.nl [94.210.171.238]) by pzwet.vanderzwet.net (Postfix) with ESMTPSA id 72323AF2BE6 for ; Thu, 5 Feb 2015 08:17:40 +0000 (UTC) Message-ID: <54D32724.60307@rickvanderzwet.nl> Date: Thu, 05 Feb 2015 09:17:40 +0100 From: Rick van der Zwet User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: freebsd-usb@freebsd.org Subject: Realtek RTL8152 driver attempt Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pzwet.vanderzwet.net X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2015 08:17:43 -0000 Hi Folks, I have been trying to write a FreeBSD driver (if_rtl) for the Realtek RTL8152 chipset, which is a USB to Ethernet dongle (using the Sitecom LN-030 v3). Some more details on the device: [root@vbsd101 /usr/src]# usbconfig -d ugen1.2 dump_device_desc ugen1.2: at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (100mA) bLength = 0x0012 bDescriptorType = 0x0001 bcdUSB = 0x0210 bDeviceClass = 0x0000 bDeviceSubClass = 0x0000 bDeviceProtocol = 0x0000 bMaxPacketSize0 = 0x0040 idVendor = 0x0bda idProduct = 0x8152 bcdDevice = 0x2000 iManufacturer = 0x0001 iProduct = 0x0002 iSerialNumber = 0x0003 <64D1A3318180> bNumConfigurations = 0x0002 [root@vbsd101 /usr/src]# usbconfig -d ugen1.2 dump_all_config_desc ugen1.2: at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (100mA) Configuration index 0 bLength = 0x0009 bDescriptorType = 0x0002 wTotalLength = 0x0027 bNumInterfaces = 0x0001 bConfigurationValue = 0x0001 iConfiguration = 0x0000 bmAttributes = 0x00a0 bMaxPower = 0x0032 Interface 0 bLength = 0x0009 bDescriptorType = 0x0004 bInterfaceNumber = 0x0000 bAlternateSetting = 0x0000 bNumEndpoints = 0x0003 bInterfaceClass = 0x00ff bInterfaceSubClass = 0x00ff bInterfaceProtocol = 0x0000 iInterface = 0x0000 Endpoint 0 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0081 bmAttributes = 0x0002 wMaxPacketSize = 0x0200 bInterval = 0x0000 bRefresh = 0x0000 bSynchAddress = 0x0000 Endpoint 1 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0002 bmAttributes = 0x0002 wMaxPacketSize = 0x0200 bInterval = 0x0000 bRefresh = 0x0000 bSynchAddress = 0x0000 Endpoint 2 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0083 bmAttributes = 0x0003 wMaxPacketSize = 0x0002 bInterval = 0x0008 bRefresh = 0x0000 bSynchAddress = 0x0000 Configuration index 1 bLength = 0x0009 bDescriptorType = 0x0002 wTotalLength = 0x0050 bNumInterfaces = 0x0002 bConfigurationValue = 0x0002 iConfiguration = 0x0000 bmAttributes = 0x00a0 bMaxPower = 0x0032 Interface 0 bLength = 0x0009 bDescriptorType = 0x0004 bInterfaceNumber = 0x0000 bAlternateSetting = 0x0000 bNumEndpoints = 0x0001 bInterfaceClass = 0x0002 bInterfaceSubClass = 0x0006 bInterfaceProtocol = 0x0000 iInterface = 0x0005 Additional Descriptor bLength = 0x05 bDescriptorType = 0x24 bDescriptorSubType = 0x00 RAW dump: 0x00 | 0x05, 0x24, 0x00, 0x10, 0x01 Additional Descriptor bLength = 0x05 bDescriptorType = 0x24 bDescriptorSubType = 0x06 RAW dump: 0x00 | 0x05, 0x24, 0x06, 0x00, 0x01 Additional Descriptor bLength = 0x0d bDescriptorType = 0x24 bDescriptorSubType = 0x0f RAW dump: 0x00 | 0x0d, 0x24, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x08 | 0xea, 0x05, 0x00, 0x00, 0x00 Endpoint 0 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0083 bmAttributes = 0x0003 wMaxPacketSize = 0x0010 bInterval = 0x0008 bRefresh = 0x0000 bSynchAddress = 0x0000 Interface 1 bLength = 0x0009 bDescriptorType = 0x0004 bInterfaceNumber = 0x0001 bAlternateSetting = 0x0000 bNumEndpoints = 0x0000 bInterfaceClass = 0x000a bInterfaceSubClass = 0x0000 bInterfaceProtocol = 0x0000 iInterface = 0x0000 Interface 1 Alt 1 bLength = 0x0009 bDescriptorType = 0x0004 bInterfaceNumber = 0x0001 bAlternateSetting = 0x0001 bNumEndpoints = 0x0002 bInterfaceClass = 0x000a bInterfaceSubClass = 0x0000 bInterfaceProtocol = 0x0000 iInterface = 0x0004 Endpoint 0 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0081 bmAttributes = 0x0002 wMaxPacketSize = 0x0200 bInterval = 0x0000 bRefresh = 0x0000 bSynchAddress = 0x0000 Endpoint 1 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0002 bmAttributes = 0x0002 wMaxPacketSize = 0x0200 bInterval = 0x0000 bRefresh = 0x0000 bSynchAddress = 0x0000 Unfortunately there is no datasheet available, I quote ``` Due to company policy, we only release Datasheet to our ODM/OEM (which have signed a company to company NDA with Realtek). Please follow the linux source code for porting, thanks.''' so I am stuck with 'reverse' engineering and best guessing. When looking at the usb trace on Linux with wireshark (https://rickvanderzwet.nl/svn/personal/freebsd-rtl-driver/linux-trace.pcapng.gz) I see a "CDC" like packets passing by, the description of the chipset also hints something in this way: "Supports CDC-ECM". [root@vbsd101 /usr/src]# usbconfig -d ugen1.2 set_config 1 [root@vbsd101 /usr/src]# tail -4 /var/log/messages Feb 5 08:58:12 vbsd101 kernel: cdce0: on usbus1 Feb 5 08:58:12 vbsd101 kernel: ue0: on cdce0 Feb 5 08:58:12 vbsd101 kernel: ue0: Ethernet address: 64:d1:a3:31:81:80 Feb 5 08:58:12 vbsd101 devd: Executing '/etc/pccard_ether ue0 start' [root@vbsd101 /usr/src]# ifconfig ue0 ue0: flags=8843 metric 0 mtu 1500 ether 64:d1:a3:31:81:80 inet 192.168.5.200 netmask 0xffffff00 broadcast 192.168.5.255 nd6 options=29 How-ever there is no traffic possible and also no bulk requests are done. Looking at the if_rue(4) and the linux r8152.c code, basically I got this far in porting but yet no working code: https://rickvanderzwet.nl/svn/personal/freebsd-rtl-driver/ There are no bulk out and in packets passing trough, so I am basically stuck now, not knowing how-to continue this journey. Could anybody give me an hint on how-to get this train going again? Thanks in advance! /Rick From owner-freebsd-usb@FreeBSD.ORG Thu Feb 5 08:58:56 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2B34A3A for ; Thu, 5 Feb 2015 08:58:56 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54C95940 for ; Thu, 5 Feb 2015 08:58:56 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 7942A1FE023; Thu, 5 Feb 2015 09:58:52 +0100 (CET) Message-ID: <54D330FE.7040007@selasky.org> Date: Thu, 05 Feb 2015 09:59:42 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Rick van der Zwet , freebsd-usb@freebsd.org Subject: Re: Realtek RTL8152 driver attempt References: <54D32724.60307@rickvanderzwet.nl> In-Reply-To: <54D32724.60307@rickvanderzwet.nl> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2015 08:58:56 -0000 On 02/05/15 09:17, Rick van der Zwet wrote: > Hi Folks, > > I have been trying to write a FreeBSD driver (if_rtl) for the Realtek > RTL8152 chipset, which is a USB to Ethernet dongle (using the Sitecom > LN-030 v3). > > Some more details on the device: > [root@vbsd101 /usr/src]# usbconfig -d ugen1.2 dump_device_desc > ugen1.2: at usbus1, cfg=0 md=HOST spd=HIGH > (480Mbps) pwr=ON (100mA) > > bLength = 0x0012 > bDescriptorType = 0x0001 > bcdUSB = 0x0210 > bDeviceClass = 0x0000 > bDeviceSubClass = 0x0000 > bDeviceProtocol = 0x0000 > bMaxPacketSize0 = 0x0040 > idVendor = 0x0bda > idProduct = 0x8152 > bcdDevice = 0x2000 > iManufacturer = 0x0001 > iProduct = 0x0002 > iSerialNumber = 0x0003 <64D1A3318180> > bNumConfigurations = 0x0002 > > > > [root@vbsd101 /usr/src]# usbconfig -d ugen1.2 dump_all_config_desc > ugen1.2: at usbus1, cfg=0 md=HOST spd=HIGH > (480Mbps) pwr=ON (100mA) > > > Configuration index 0 > > bLength = 0x0009 > bDescriptorType = 0x0002 > wTotalLength = 0x0027 > bNumInterfaces = 0x0001 > bConfigurationValue = 0x0001 > iConfiguration = 0x0000 > bmAttributes = 0x00a0 > bMaxPower = 0x0032 > > Interface 0 > bLength = 0x0009 > bDescriptorType = 0x0004 > bInterfaceNumber = 0x0000 > bAlternateSetting = 0x0000 > bNumEndpoints = 0x0003 > bInterfaceClass = 0x00ff > bInterfaceSubClass = 0x00ff > bInterfaceProtocol = 0x0000 > iInterface = 0x0000 > > Endpoint 0 > bLength = 0x0007 > bDescriptorType = 0x0005 > bEndpointAddress = 0x0081 > bmAttributes = 0x0002 > wMaxPacketSize = 0x0200 > bInterval = 0x0000 > bRefresh = 0x0000 > bSynchAddress = 0x0000 > > Endpoint 1 > bLength = 0x0007 > bDescriptorType = 0x0005 > bEndpointAddress = 0x0002 > bmAttributes = 0x0002 > wMaxPacketSize = 0x0200 > bInterval = 0x0000 > bRefresh = 0x0000 > bSynchAddress = 0x0000 > > Endpoint 2 > bLength = 0x0007 > bDescriptorType = 0x0005 > bEndpointAddress = 0x0083 > bmAttributes = 0x0003 > wMaxPacketSize = 0x0002 > bInterval = 0x0008 > bRefresh = 0x0000 > bSynchAddress = 0x0000 > > > > Configuration index 1 > > bLength = 0x0009 > bDescriptorType = 0x0002 > wTotalLength = 0x0050 > bNumInterfaces = 0x0002 > bConfigurationValue = 0x0002 > iConfiguration = 0x0000 > bmAttributes = 0x00a0 > bMaxPower = 0x0032 > > Interface 0 > bLength = 0x0009 > bDescriptorType = 0x0004 > bInterfaceNumber = 0x0000 > bAlternateSetting = 0x0000 > bNumEndpoints = 0x0001 > bInterfaceClass = 0x0002 > bInterfaceSubClass = 0x0006 > bInterfaceProtocol = 0x0000 > iInterface = 0x0005 > > Additional Descriptor > > bLength = 0x05 > bDescriptorType = 0x24 > bDescriptorSubType = 0x00 > RAW dump: > 0x00 | 0x05, 0x24, 0x00, 0x10, 0x01 > > > Additional Descriptor > > bLength = 0x05 > bDescriptorType = 0x24 > bDescriptorSubType = 0x06 > RAW dump: > 0x00 | 0x05, 0x24, 0x06, 0x00, 0x01 > > > Additional Descriptor > > bLength = 0x0d > bDescriptorType = 0x24 > bDescriptorSubType = 0x0f > RAW dump: > 0x00 | 0x0d, 0x24, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, > 0x08 | 0xea, 0x05, 0x00, 0x00, 0x00 > > > Endpoint 0 > bLength = 0x0007 > bDescriptorType = 0x0005 > bEndpointAddress = 0x0083 > bmAttributes = 0x0003 > wMaxPacketSize = 0x0010 > bInterval = 0x0008 > bRefresh = 0x0000 > bSynchAddress = 0x0000 > > > Interface 1 > bLength = 0x0009 > bDescriptorType = 0x0004 > bInterfaceNumber = 0x0001 > bAlternateSetting = 0x0000 > bNumEndpoints = 0x0000 > bInterfaceClass = 0x000a > bInterfaceSubClass = 0x0000 > bInterfaceProtocol = 0x0000 > iInterface = 0x0000 > > > Interface 1 Alt 1 > bLength = 0x0009 > bDescriptorType = 0x0004 > bInterfaceNumber = 0x0001 > bAlternateSetting = 0x0001 > bNumEndpoints = 0x0002 > bInterfaceClass = 0x000a > bInterfaceSubClass = 0x0000 > bInterfaceProtocol = 0x0000 > iInterface = 0x0004 > > Endpoint 0 > bLength = 0x0007 > bDescriptorType = 0x0005 > bEndpointAddress = 0x0081 > bmAttributes = 0x0002 > wMaxPacketSize = 0x0200 > bInterval = 0x0000 > bRefresh = 0x0000 > bSynchAddress = 0x0000 > > Endpoint 1 > bLength = 0x0007 > bDescriptorType = 0x0005 > bEndpointAddress = 0x0002 > bmAttributes = 0x0002 > wMaxPacketSize = 0x0200 > bInterval = 0x0000 > bRefresh = 0x0000 > bSynchAddress = 0x0000 > > > Unfortunately there is no datasheet available, I quote ``` Due to > company policy, we only release Datasheet to our ODM/OEM (which have > signed a company to company NDA with Realtek). Please follow the linux > source code for porting, thanks.''' so I am stuck with 'reverse' > engineering and best guessing. > > > When looking at the usb trace on Linux with wireshark > (https://rickvanderzwet.nl/svn/personal/freebsd-rtl-driver/linux-trace.pcapng.gz) > I see a "CDC" like packets passing by, the description of the chipset > also hints something in this way: "Supports CDC-ECM". > > > [root@vbsd101 /usr/src]# usbconfig -d ugen1.2 set_config 1 > > [root@vbsd101 /usr/src]# tail -4 /var/log/messages > Feb 5 08:58:12 vbsd101 kernel: cdce0: on > usbus1 > Feb 5 08:58:12 vbsd101 kernel: ue0: on cdce0 > Feb 5 08:58:12 vbsd101 kernel: ue0: Ethernet address: 64:d1:a3:31:81:80 > Feb 5 08:58:12 vbsd101 devd: Executing '/etc/pccard_ether ue0 start' > > [root@vbsd101 /usr/src]# ifconfig ue0 > ue0: flags=8843 metric 0 mtu 1500 > ether 64:d1:a3:31:81:80 > inet 192.168.5.200 netmask 0xffffff00 broadcast 192.168.5.255 > nd6 options=29 > > How-ever there is no traffic possible and also no bulk requests are done. > > > > Looking at the if_rue(4) and the linux r8152.c code, basically I got > this far in porting but yet no working code: > https://rickvanderzwet.nl/svn/personal/freebsd-rtl-driver/ > > There are no bulk out and in packets passing trough, so I am basically > stuck now, not knowing how-to continue this journey. Could anybody give > me an hint on how-to get this train going again? > > Thanks in advance! > /Rick Hi Rick, I think this hardware is compatible to if_cdce, but you need to implement some vendor specific codes to handle the PHY/MIIBUS. That is what makes it a bit difficult. --HPS From owner-freebsd-usb@FreeBSD.ORG Thu Feb 5 09:00:40 2015 Return-Path: Delivered-To: freebsd-usb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E9C5FB63 for ; Thu, 5 Feb 2015 09:00:40 +0000 (UTC) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D05A09E7 for ; Thu, 5 Feb 2015 09:00:40 +0000 (UTC) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t1590eW8085214 for ; Thu, 5 Feb 2015 09:00:40 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-usb@FreeBSD.org Subject: [Bug 156596] [ehci] Extremely high interrupt rate on ehci/uhci IRQ16 80% cpu utilization on CPU0 Date: Thu, 05 Feb 2015 09:00:40 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: 8.2-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: hselasky@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: freebsd-usb@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2015 09:00:41 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=156596 Hans Petter Selasky changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hselasky@FreeBSD.org --- Comment #16 from Hans Petter Selasky --- Created attachment 152572 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=152572&action=edit UHCI patch Does the attached patch make any difference? --HPS -- You are receiving this mail because: You are the assignee for the bug. From owner-freebsd-usb@FreeBSD.ORG Thu Feb 5 11:55:24 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51F1CC46 for ; Thu, 5 Feb 2015 11:55:24 +0000 (UTC) Received: from mail-qc0-f175.google.com (mail-qc0-f175.google.com [209.85.216.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 12B86E33 for ; Thu, 5 Feb 2015 11:55:23 +0000 (UTC) Received: by mail-qc0-f175.google.com with SMTP id c9so5913961qcz.6 for ; Thu, 05 Feb 2015 03:55:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=OZ0MlrqZU/LNSjGPOBNOAkFnvVMiP9WIMsXTV/ddbe0=; b=CiB75Q4HqrI66joBcsjPH7UZjS7a77lVpkKYFWGuAReISjJG3SdEovVKJGcHrc9L17 OSxcXrZmKBxSO1CSlEepevcUrrVeGpuJmRx+1Fm0FrwxB53OSvChvS7ZxNedz2j+hOKD 0VaUYr/Q0PJnsPmnXLFgTh4TWP2lQ8NyRHYPi4TBSdZiUgYTeZSRqpNnpwHc/XdPCpD3 uE3spyIwlvLOBzyHbikH2AxKIYqobWykDal553ddtkLVr0OeNnovf0NyXh/JCwxqtg4q WuOXx/oUo5gNRNGbnTL6usV7MxwihceGFolHXEuhH02SWUDKrXAyu/nd30wDPJMQKYjO s97A== X-Gm-Message-State: ALoCoQkVP0eNW+zyy4s8qNRjVvq5Dic5vWl7PVkeYtSRA8igDseYWNbtSPDeMSWRlCwjSB0MFNdhX7EQhEta/xrAKBMhe4qPtQu6ITXrB3MYFFD1IrBhI+u6MUYVMCNjin9rnLwUAzRe X-Received: by 10.224.161.14 with SMTP id p14mr7142405qax.77.1423137317355; Thu, 05 Feb 2015 03:55:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.96.215.36 with HTTP; Thu, 5 Feb 2015 03:55:02 -0800 (PST) From: "Lundberg, Johannes" Date: Thu, 5 Feb 2015 20:55:02 +0900 Message-ID: Subject: Macbook touchpad wsp To: "freebsd-usb@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2015 11:55:24 -0000 SGkNCg0KQWZ0ZXIgc29tZSB0aW1lIGF3YXkgSSBpbnN0YWxsZWQgdGhlIG5ld2VzdCBzbmFwc2hv dCBvbiBteSBtYWNib29rIGFpciAyMDEzLg0KSSdtIGNlcnRhaW4gdGhhdCB0aGUgd3NwIGRyaXZl ciB3b3JrZWQgYmVmb3JlIGJ1dCBub3cgSSBjYW4ndCBzZWVtIHRvIGdldA0KaXQgdG8gcmVjb2du aXplIG15IG1hY2Jvb2sncyB0b3VjaHBhZC4uIEkgY29uZmlybSB0aGF0IHRoZSBwcm9kdWN0IGlk IGlzDQpsaXN0ZWQgaW4gd3NwLmMgYnV0IG5vdGhpbmcgaGFwcGVucyB3aGVuIEkgbG9hZCB0aGUg bW9kdWxlLi4NCg0KQW55IGlkZWEgd2hhdCBoYXMgaGFwcGVuZWQ/DQotLQ0KSm9oYW5uZXMgTHVu ZGJlcmcNCkJSSUxMSUFOVFNFUlZJQ0UgQ08uLCBMVEQuDQoKLS0gCj0tPS09LT0tPS09LT0tPS09 LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tPS09LQrnp5jlr4bkv53mjIHjgavjgaTj gYTjgabvvJrjgZPjga7pm7vlrZDjg6Hjg7zjg6vjga/jgIHlkI3lrpvkurrjgavpgIHkv6HjgZfj gZ/jgoLjga7jgafjgYLjgorjgIHnp5jljL/nibnmqKnjga7lr77osaHjgajjgarjgovmg4XloLHj gpLlkKvjgpPjgafjgYTjgb7jgZnjgIIK44KC44GX44CB5ZCN5a6b5Lq65Lul5aSW44Gu5pa544GM 5Y+X5L+h44GV44KM44Gf5aC05ZCI44CB44GT44Gu44Oh44O844Or44Gu56C05qOE44CB44GK44KI 44Gz44GT44Gu44Oh44O844Or44Gr6Zai44GZ44KL5LiA5YiH44Gu6ZaL56S644CBCuikh+WGmeOA gemFjeW4g+OAgeOBneOBruS7luOBruWIqeeUqOOAgeOBvuOBn+OBr+iomOi8ieWGheWuueOBq+Wf uuOBpeOBj+OBhOOBi+OBquOCi+ihjOWLleOCguOBleOCjOOBquOBhOOCiOOBhuOBiumhmOOBhOeU s+OBl+S4iuOBkuOBvuOBmeOAggotLS0KQ09ORklERU5USUFMSVRZIE5PVEU6IFRoZSBpbmZvcm1h dGlvbiBpbiB0aGlzIGVtYWlsIGlzIGNvbmZpZGVudGlhbAphbmQgaW50ZW5kZWQgc29sZWx5IGZv ciB0aGUgYWRkcmVzc2VlLgpEaXNjbG9zdXJlLCBjb3B5aW5nLCBkaXN0cmlidXRpb24gb3IgYW55 IG90aGVyIGFjdGlvbiBvZiB1c2Ugb2YgdGhpcwplbWFpbCBieSBwZXJzb24gb3RoZXIgdGhhbiBp bnRlbmRlZCByZWNpcGllbnQsIGlzIHByb2hpYml0ZWQuCklmIHlvdSBhcmUgbm90IHRoZSBpbnRl bmRlZCByZWNpcGllbnQgYW5kIGhhdmUgcmVjZWl2ZWQgdGhpcyBlbWFpbCBpbgplcnJvciwgcGxl YXNlIGRlc3Ryb3kgdGhlIG9yaWdpbmFsIG1lc3NhZ2UuCg== From owner-freebsd-usb@FreeBSD.ORG Thu Feb 5 15:34:41 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 373C03D7 for ; Thu, 5 Feb 2015 15:34:41 +0000 (UTC) Received: from ns.kevlo.org (220-135-115-6.HINET-IP.hinet.net [220.135.115.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "ns.kevlo.org", Issuer "ns.kevlo.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D9AD3CB0 for ; Thu, 5 Feb 2015 15:34:39 +0000 (UTC) Received: from ns.kevlo.org (localhost [127.0.0.1]) by ns.kevlo.org (8.14.9/8.14.9) with ESMTP id t15FXusu085816 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 5 Feb 2015 23:33:57 +0800 (CST) (envelope-from kevlo@ns.kevlo.org) Received: (from kevlo@localhost) by ns.kevlo.org (8.14.9/8.14.9/Submit) id t15FXtaM085815; Thu, 5 Feb 2015 23:33:55 +0800 (CST) (envelope-from kevlo) Date: Thu, 5 Feb 2015 23:33:55 +0800 From: Kevin Lo To: Rick van der Zwet Subject: Re: Realtek RTL8152 driver attempt Message-ID: <20150205153355.GA85786@ns.kevlo.org> References: <54D32724.60307@rickvanderzwet.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54D32724.60307@rickvanderzwet.nl> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2015 15:34:41 -0000 On Thu, Feb 05, 2015 at 09:17:40AM +0100, Rick van der Zwet wrote: > > Hi Folks, Hi Rick, > I have been trying to write a FreeBSD driver (if_rtl) for the Realtek > RTL8152 chipset, which is a USB to Ethernet dongle (using the Sitecom > LN-030 v3). What a coincidence. I've been slowly working on porting r8152 driver from Linux to FreeBSD since last month. > Some more details on the device: > [root@vbsd101 /usr/src]# usbconfig -d ugen1.2 dump_device_desc > ugen1.2: at usbus1, cfg=0 md=HOST spd=HIGH > (480Mbps) pwr=ON (100mA) > > bLength = 0x0012 > bDescriptorType = 0x0001 > bcdUSB = 0x0210 > bDeviceClass = 0x0000 > bDeviceSubClass = 0x0000 > bDeviceProtocol = 0x0000 > bMaxPacketSize0 = 0x0040 > idVendor = 0x0bda > idProduct = 0x8152 > bcdDevice = 0x2000 > iManufacturer = 0x0001 > iProduct = 0x0002 > iSerialNumber = 0x0003 <64D1A3318180> > bNumConfigurations = 0x0002 > > > > [root@vbsd101 /usr/src]# usbconfig -d ugen1.2 dump_all_config_desc > ugen1.2: at usbus1, cfg=0 md=HOST spd=HIGH > (480Mbps) pwr=ON (100mA) > > > Configuration index 0 > > bLength = 0x0009 > bDescriptorType = 0x0002 > wTotalLength = 0x0027 > bNumInterfaces = 0x0001 > bConfigurationValue = 0x0001 > iConfiguration = 0x0000 > bmAttributes = 0x00a0 > bMaxPower = 0x0032 > > Interface 0 > bLength = 0x0009 > bDescriptorType = 0x0004 > bInterfaceNumber = 0x0000 > bAlternateSetting = 0x0000 > bNumEndpoints = 0x0003 > bInterfaceClass = 0x00ff > bInterfaceSubClass = 0x00ff > bInterfaceProtocol = 0x0000 > iInterface = 0x0000 > > Endpoint 0 > bLength = 0x0007 > bDescriptorType = 0x0005 > bEndpointAddress = 0x0081 > bmAttributes = 0x0002 > wMaxPacketSize = 0x0200 > bInterval = 0x0000 > bRefresh = 0x0000 > bSynchAddress = 0x0000 > > Endpoint 1 > bLength = 0x0007 > bDescriptorType = 0x0005 > bEndpointAddress = 0x0002 > bmAttributes = 0x0002 > wMaxPacketSize = 0x0200 > bInterval = 0x0000 > bRefresh = 0x0000 > bSynchAddress = 0x0000 > > Endpoint 2 > bLength = 0x0007 > bDescriptorType = 0x0005 > bEndpointAddress = 0x0083 > bmAttributes = 0x0003 > wMaxPacketSize = 0x0002 > bInterval = 0x0008 > bRefresh = 0x0000 > bSynchAddress = 0x0000 > > > > Configuration index 1 > > bLength = 0x0009 > bDescriptorType = 0x0002 > wTotalLength = 0x0050 > bNumInterfaces = 0x0002 > bConfigurationValue = 0x0002 > iConfiguration = 0x0000 > bmAttributes = 0x00a0 > bMaxPower = 0x0032 > > Interface 0 > bLength = 0x0009 > bDescriptorType = 0x0004 > bInterfaceNumber = 0x0000 > bAlternateSetting = 0x0000 > bNumEndpoints = 0x0001 > bInterfaceClass = 0x0002 > bInterfaceSubClass = 0x0006 > bInterfaceProtocol = 0x0000 > iInterface = 0x0005 > > Additional Descriptor > > bLength = 0x05 > bDescriptorType = 0x24 > bDescriptorSubType = 0x00 > RAW dump: > 0x00 | 0x05, 0x24, 0x00, 0x10, 0x01 > > > Additional Descriptor > > bLength = 0x05 > bDescriptorType = 0x24 > bDescriptorSubType = 0x06 > RAW dump: > 0x00 | 0x05, 0x24, 0x06, 0x00, 0x01 > > > Additional Descriptor > > bLength = 0x0d > bDescriptorType = 0x24 > bDescriptorSubType = 0x0f > RAW dump: > 0x00 | 0x0d, 0x24, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, > 0x08 | 0xea, 0x05, 0x00, 0x00, 0x00 > > > Endpoint 0 > bLength = 0x0007 > bDescriptorType = 0x0005 > bEndpointAddress = 0x0083 > bmAttributes = 0x0003 > wMaxPacketSize = 0x0010 > bInterval = 0x0008 > bRefresh = 0x0000 > bSynchAddress = 0x0000 > > > Interface 1 > bLength = 0x0009 > bDescriptorType = 0x0004 > bInterfaceNumber = 0x0001 > bAlternateSetting = 0x0000 > bNumEndpoints = 0x0000 > bInterfaceClass = 0x000a > bInterfaceSubClass = 0x0000 > bInterfaceProtocol = 0x0000 > iInterface = 0x0000 > > > Interface 1 Alt 1 > bLength = 0x0009 > bDescriptorType = 0x0004 > bInterfaceNumber = 0x0001 > bAlternateSetting = 0x0001 > bNumEndpoints = 0x0002 > bInterfaceClass = 0x000a > bInterfaceSubClass = 0x0000 > bInterfaceProtocol = 0x0000 > iInterface = 0x0004 > > Endpoint 0 > bLength = 0x0007 > bDescriptorType = 0x0005 > bEndpointAddress = 0x0081 > bmAttributes = 0x0002 > wMaxPacketSize = 0x0200 > bInterval = 0x0000 > bRefresh = 0x0000 > bSynchAddress = 0x0000 > > Endpoint 1 > bLength = 0x0007 > bDescriptorType = 0x0005 > bEndpointAddress = 0x0002 > bmAttributes = 0x0002 > wMaxPacketSize = 0x0200 > bInterval = 0x0000 > bRefresh = 0x0000 > bSynchAddress = 0x0000 > > > Unfortunately there is no datasheet available, I quote ``` Due to > company policy, we only release Datasheet to our ODM/OEM (which have > signed a company to company NDA with Realtek). Please follow the linux > source code for porting, thanks.''' so I am stuck with 'reverse' > engineering and best guessing. I contacted with a Linux driver maintainer and asked if he could provide me the data sheet of RTL8152, not surprisingly, he couldn't send me a copy, but he would try to answer my questions. > When looking at the usb trace on Linux with wireshark > (https://rickvanderzwet.nl/svn/personal/freebsd-rtl-driver/linux-trace.pcapng.gz) > I see a "CDC" like packets passing by, the description of the chipset > also hints something in this way: "Supports CDC-ECM". > > > [root@vbsd101 /usr/src]# usbconfig -d ugen1.2 set_config 1 > > [root@vbsd101 /usr/src]# tail -4 /var/log/messages > Feb 5 08:58:12 vbsd101 kernel: cdce0: on > usbus1 > Feb 5 08:58:12 vbsd101 kernel: ue0: on cdce0 > Feb 5 08:58:12 vbsd101 kernel: ue0: Ethernet address: 64:d1:a3:31:81:80 > Feb 5 08:58:12 vbsd101 devd: Executing '/etc/pccard_ether ue0 start' > > [root@vbsd101 /usr/src]# ifconfig ue0 > ue0: flags=8843 metric 0 mtu 1500 > ether 64:d1:a3:31:81:80 > inet 192.168.5.200 netmask 0xffffff00 broadcast 192.168.5.255 > nd6 options=29 > > How-ever there is no traffic possible and also no bulk requests are done. > > > > Looking at the if_rue(4) and the linux r8152.c code, basically I got > this far in porting but yet no working code: > https://rickvanderzwet.nl/svn/personal/freebsd-rtl-driver/ > > There are no bulk out and in packets passing trough, so I am basically > stuck now, not knowing how-to continue this journey. Could anybody give > me an hint on how-to get this train going again? Mine basically is working but needs serious cleanup and bug fixes. http://people.freebsd.org/~kevlo/ure.diff Please let me know if it works for you, thanks. > Thanks in advance! > /Rick Kevin From owner-freebsd-usb@FreeBSD.ORG Thu Feb 5 16:53:01 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43B40344; Thu, 5 Feb 2015 16:53:01 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 057AA8E8; Thu, 5 Feb 2015 16:53:01 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 67DD61FE023; Thu, 5 Feb 2015 17:52:57 +0100 (CET) Message-ID: <54D3A01B.80808@selasky.org> Date: Thu, 05 Feb 2015 17:53:47 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Kevin Lo , Rick van der Zwet Subject: Re: Realtek RTL8152 driver attempt References: <54D32724.60307@rickvanderzwet.nl> <20150205153355.GA85786@ns.kevlo.org> In-Reply-To: <20150205153355.GA85786@ns.kevlo.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2015 16:53:01 -0000 On 02/05/15 16:33, Kevin Lo wrote: > On Thu, Feb 05, 2015 at 09:17:40AM +0100, Rick van der Zwet wrote: >> >> Hi Folks, > > Hi Rick, > > > Mine basically is working but needs serious cleanup and bug fixes. > http://people.freebsd.org/~kevlo/ure.diff > > Please let me know if it works for you, thanks. Maybe use "pause_mtx()" instead of "DELAY()" ? --HPS From owner-freebsd-usb@FreeBSD.ORG Thu Feb 5 22:06:30 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5653AA56 for ; Thu, 5 Feb 2015 22:06:30 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19FEE38D for ; Thu, 5 Feb 2015 22:06:30 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 9D8551FE023; Thu, 5 Feb 2015 23:06:27 +0100 (CET) Message-ID: <54D3E995.9050205@selasky.org> Date: Thu, 05 Feb 2015 23:07:17 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: "Lundberg, Johannes" , "freebsd-usb@freebsd.org" Subject: Re: Macbook touchpad wsp References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2015 22:06:30 -0000 On 02/05/15 12:55, Lundberg, Johannes wrote: > Hi > > After some time away I installed the newest snapshot on my macbook air 2013. > I'm certain that the wsp driver worked before but now I can't seem to get > it to recognize my macbook's touchpad.. I confirm that the product id is > listed in wsp.c but nothing happens when I load the module.. > > Any idea what has happened? Hi, Some suggestions: 1) Can you show dmesg? 2) kldload atp wsp 3) moused_enable="YES" 4) moused_enable="NO" 5) https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196678 --HPS From owner-freebsd-usb@FreeBSD.ORG Thu Feb 5 23:58:09 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B40ACE2 for ; Thu, 5 Feb 2015 23:58:09 +0000 (UTC) Received: from mail-qg0-f49.google.com (mail-qg0-f49.google.com [209.85.192.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2924E141 for ; Thu, 5 Feb 2015 23:58:08 +0000 (UTC) Received: by mail-qg0-f49.google.com with SMTP id e89so8824845qgf.8 for ; Thu, 05 Feb 2015 15:58:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=ps0vlxUU06Rm3xSTL6TO2c3Xk/Qr6/vbAGdwc6pFskw=; b=So+FNlAkp+2hHMf8IXNz0HEh/xStBtMqXDwkLGFwquH/WPWSibtfeJKvuGrZbX9zBE kSQp5dNX7AAfyk7dcZZyxEdKblSVwMbIcJ9gcUEgJqV7gWUb4eH6nWJ3tMWZ3BmwKfp9 EAv9jLIM+vdFU24Z+z1ezOyxS+FAh6OlegdgHEPTyfOVtPQ6U1DZoGnpS44XzzpT1gTq OL89MPaiMxtLvCu6vPXB1dmEE65hcLt1IRNn0jlggxcAany7QVpSt2yklUdpBalkw5dY ClB1wuuEbat3WgMvOQpwG3XutvXKeaB3MOXAdml3vTf3v+xAuTp4AFIZzt25N81bSY1w W9NQ== X-Gm-Message-State: ALoCoQny6kO+jRKK+vj6HhcYJ0fr+qMFNO8vzLEKn7X2OWIVhT9QweJM7KVt642s9bMr//JH9pA70PkbKzo8VFg2tOByNAqNL3/eYSkoN2FDvM/5aWB/K0pVXZP+tiHWTmb0wAW7MjtW X-Received: by 10.140.36.239 with SMTP id p102mr1848802qgp.8.1423180682171; Thu, 05 Feb 2015 15:58:02 -0800 (PST) MIME-Version: 1.0 Received: by 10.96.215.36 with HTTP; Thu, 5 Feb 2015 15:57:45 -0800 (PST) In-Reply-To: <54D3E995.9050205@selasky.org> References: <54D3E995.9050205@selasky.org> From: "Lundberg, Johannes" Date: Fri, 6 Feb 2015 08:57:45 +0900 Message-ID: Subject: Re: Macbook touchpad wsp To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "freebsd-usb@freebsd.org" X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2015 23:58:09 -0000 SGkgSGFucw0KDQpkbWVzZyBpcyBoZXJlIGh0dHA6Ly9wYXN0ZWJpbi5jb20vMjc2V0tRN0gNCg0K Tm8gbWF0dGVyIGhvdyBJIHNldCBtb3VzZWRfZW5hYmxlDQoiL3Vzci9iaW4vbW91c2VkIC1wIC9k ZXYvdW1zMSAtdCBhdXRvIC1JIC92YXIvcnVuL21vdXNlZC51bXMxLnBpZCINCmdldCBzdGFydGVk IGF1dG9tYXRpY2FsbHkuIFRoaXMgaXMgdG8gbG9naW4gcHJvbXB0LCBubyBYLg0KDQprbGRsb2Fk IGF0cCBvciB3c3AgZ2VuZXJhdGVzIG5vIG1lc3NhZ2UgZnJvbSB0aGUga2VybmVsLiBOZWl0aGVy IC9kZXYvYXRwDQpvciAvZGV2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GG44GK6aGY44GE55Sz44GX5LiK44GS44G+44GZ44CCCi0tLQpDT05G SURFTlRJQUxJVFkgTk9URTogVGhlIGluZm9ybWF0aW9uIGluIHRoaXMgZW1haWwgaXMgY29uZmlk ZW50aWFsCmFuZCBpbnRlbmRlZCBzb2xlbHkgZm9yIHRoZSBhZGRyZXNzZWUuCkRpc2Nsb3N1cmUs IGNvcHlpbmcsIGRpc3RyaWJ1dGlvbiBvciBhbnkgb3RoZXIgYWN0aW9uIG9mIHVzZSBvZiB0aGlz CmVtYWlsIGJ5IHBlcnNvbiBvdGhlciB0aGFuIGludGVuZGVkIHJlY2lwaWVudCwgaXMgcHJvaGli aXRlZC4KSWYgeW91IGFyZSBub3QgdGhlIGludGVuZGVkIHJlY2lwaWVudCBhbmQgaGF2ZSByZWNl aXZlZCB0aGlzIGVtYWlsIGluCmVycm9yLCBwbGVhc2UgZGVzdHJveSB0aGUgb3JpZ2luYWwgbWVz c2FnZS4K From owner-freebsd-usb@FreeBSD.ORG Fri Feb 6 01:23:31 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C0ACCAF1 for ; Fri, 6 Feb 2015 01:23:31 +0000 (UTC) Received: from ns.kevlo.org (220-135-115-6.HINET-IP.hinet.net [220.135.115.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "ns.kevlo.org", Issuer "ns.kevlo.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FBFDB23 for ; Fri, 6 Feb 2015 01:23:30 +0000 (UTC) Received: from ns.kevlo.org (localhost [127.0.0.1]) by ns.kevlo.org (8.14.9/8.14.9) with ESMTP id t161MqqD090846 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 6 Feb 2015 09:22:53 +0800 (CST) (envelope-from kevlo@ns.kevlo.org) Received: (from kevlo@localhost) by ns.kevlo.org (8.14.9/8.14.9/Submit) id t161MpWm090843; Fri, 6 Feb 2015 09:22:51 +0800 (CST) (envelope-from kevlo) Date: Fri, 6 Feb 2015 09:22:50 +0800 From: Kevin Lo To: Hans Petter Selasky Subject: Re: Realtek RTL8152 driver attempt Message-ID: <20150206012250.GA90812@ns.kevlo.org> References: <54D32724.60307@rickvanderzwet.nl> <20150205153355.GA85786@ns.kevlo.org> <54D3A01B.80808@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54D3A01B.80808@selasky.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2015 01:23:31 -0000 On Thu, Feb 05, 2015 at 05:53:47PM +0100, Hans Petter Selasky wrote: > > On 02/05/15 16:33, Kevin Lo wrote: > > On Thu, Feb 05, 2015 at 09:17:40AM +0100, Rick van der Zwet wrote: > >> > >> Hi Folks, > > > > Hi Rick, > > > > > > > Mine basically is working but needs serious cleanup and bug fixes. > > http://people.freebsd.org/~kevlo/ure.diff > > > > Please let me know if it works for you, thanks. > > Maybe use "pause_mtx()" instead of "DELAY()" ? Will do, thanks. > --HPS Kevin From owner-freebsd-usb@FreeBSD.ORG Fri Feb 6 07:10:14 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2FDA7173 for ; Fri, 6 Feb 2015 07:10:14 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E094B178 for ; Fri, 6 Feb 2015 07:10:13 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 915641FE023; Fri, 6 Feb 2015 08:10:02 +0100 (CET) Message-ID: <54D468FC.4020003@selasky.org> Date: Fri, 06 Feb 2015 08:10:52 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: "Lundberg, Johannes" Subject: Re: Macbook touchpad wsp References: <54D3E995.9050205@selasky.org> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "freebsd-usb@freebsd.org" X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2015 07:10:14 -0000 On 02/06/15 00:57, Lundberg, Johannes wrote: > Hi Hans > > dmesg is here http://pastebin.com/276WKQ7H > > No matter how I set moused_enable > "/usr/bin/moused -p /dev/ums1 -t auto -I /var/run/moused.ums1.pid" > get started automatically. This is to login prompt, no X. > > kldload atp or wsp generates no message from the kernel. Neither /dev/atp > or /dev/wsp is created. > > I tried removing ums.ko from kernel folder but same result except that > /dev/ums is never created and moused never started. > > I tried comment out the ums moused part in devd.conf but no difference. > > My device is properly listed in /etc/devd/usb.conf under wsp driver... > > Don't know if it makes any difference but I am using UEFI. > Hi, I'll have a look. Is your Xorg compiled with Hald or Devd support? --HPS From owner-freebsd-usb@FreeBSD.ORG Fri Feb 6 07:15:05 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3E3D7DCC for ; Fri, 6 Feb 2015 07:15:05 +0000 (UTC) Received: from mail-qc0-f171.google.com (mail-qc0-f171.google.com [209.85.216.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE66822A for ; Fri, 6 Feb 2015 07:15:04 +0000 (UTC) Received: by mail-qc0-f171.google.com with SMTP id s11so10477287qcv.2 for ; Thu, 05 Feb 2015 23:15:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=ISaHJ3b6Cb/JJgVwCGl2GPiM019RxzAzTIIcxDnnQC8=; b=VJwbLcFLgCn7oXKk/01uiLTbY8sVb8+bRIca6aKDxURHLyzh5yAjNSG77mftKxIqMD smooZmjlXh78TYlBU9H4Qjg1cvWrFxoDQ7ti/13iibSYVSCvwn80KbY4iIJubDBb7mh0 ySxpvkv0fwiLw2rgVdxRaRKNofYWnpag5vMObiLxl44+nk2b1K45YToeQwxo4lJj7ovj 80yOimRHYj90lSrwQ0vOKPVocobAA6Ec6n9Yoa2H1w6OZ1CQTHSMIXy7Btgxn8lhYNq8 yhCrY5RMGe41SnnsekrkvuvM7gk0YsI2IjNRRz1pgOyGQfMgQ4px6eGxGn6CnGHqC78p wc7g== X-Gm-Message-State: ALoCoQnqNOxiJFbxAj6nGN4bkToke0Cgy0bsL7m6r690D1nc3PACP1kGtFii6OK2JzsDIKLevme6AyH9arC/5UTcHO42500yg5OWHmqiTXnJTYmKyqJ3tH7DA8Rv03Vs+UjY9d0I20/p X-Received: by 10.140.106.72 with SMTP id d66mr125401qgf.60.1423206903691; Thu, 05 Feb 2015 23:15:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.96.215.36 with HTTP; Thu, 5 Feb 2015 23:14:48 -0800 (PST) In-Reply-To: <54D468FC.4020003@selasky.org> References: <54D3E995.9050205@selasky.org> <54D468FC.4020003@selasky.org> From: "Lundberg, Johannes" Date: Fri, 6 Feb 2015 16:14:48 +0900 Message-ID: Subject: Re: Macbook touchpad wsp To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "freebsd-usb@freebsd.org" X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2015 07:15:05 -0000 SSB0aGluayBpdCB3YXMgdGhlIGRlZmF1bHQsIGRldmQuIEJ1dCB0aGlzIHByb2JsZW0gaXMgbm90 IHdpdGggWC4gSSBzaG91bGQNCmJlIGFibGUgdG8gZ2V0IHRoZSB0b3VjaHBhZCB3b3JraW5nIG9u IGNvbnNvbGUgdG9vLCByaWdodD8gSSBtZWFuLCBpdCB3b3Jrcw0Kd2l0aCB1bXMgYm90aCBpbiBj b25zb2xlIGFuZCBpbiBYIGJ1dCBhdHAgYW5kIHdzcCB3b24ndCBhdHRhY2ggdGhlIGRldmljZS4N Cg0KLS0NCkpvaGFubmVzIEx1bmRiZXJnDQpCUklMTElBTlRTRVJWSUNFIENPLiwgTFRELg0KDQpP biBGcmksIEZlYiA2LCAyMDE1IGF0IDQ6MTAgUE0sIEhhbnMgUGV0dGVyIFNlbGFza3kgPGhwc0Bz ZWxhc2t5Lm9yZz4gd3JvdGU6DQoNCj4gT24gMDIvMDYvMTUgMDA6NTcsIEx1bmRi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ZW5kZWQgcmVjaXBpZW50IGFuZCBoYXZlIHJlY2VpdmVkIHRoaXMgZW1haWwgaW4KZXJyb3Is IHBsZWFzZSBkZXN0cm95IHRoZSBvcmlnaW5hbCBtZXNzYWdlLgo= From owner-freebsd-usb@FreeBSD.ORG Fri Feb 6 07:30:02 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38873B77 for ; Fri, 6 Feb 2015 07:30:02 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB84833B for ; Fri, 6 Feb 2015 07:30:01 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id E86891FE023; Fri, 6 Feb 2015 08:29:58 +0100 (CET) Message-ID: <54D46DA9.5000303@selasky.org> Date: Fri, 06 Feb 2015 08:30:49 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: "Lundberg, Johannes" Subject: Re: Macbook touchpad wsp References: <54D3E995.9050205@selasky.org> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "freebsd-usb@freebsd.org" X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2015 07:30:02 -0000 Hi, The problem is that your WSP vendor and product ID is not listed in the WSP.c device table. You'll need to add it in order for the wsp driver to attach. Can you test? Also please send full output from: usbconfig -d X.Y dump_curr_config_desc dump_device_desc --HPS From owner-freebsd-usb@FreeBSD.ORG Fri Feb 6 07:37:33 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF1C0B19 for ; Fri, 6 Feb 2015 07:37:33 +0000 (UTC) Received: from mail-qg0-f51.google.com (mail-qg0-f51.google.com [209.85.192.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AB175E6 for ; Fri, 6 Feb 2015 07:37:32 +0000 (UTC) Received: by mail-qg0-f51.google.com with SMTP id z60so6059855qgd.10 for ; Thu, 05 Feb 2015 23:37:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=f0uU71T/mPcz6ILmBcQErkUOZwNl4BvORuYZ8OKC/Bg=; b=FRORH08PZCzY68KtgCZbYf19+4G47Fqty2MnnIqzNTl5eTJx4BQ5i/2hsQKOq35Epy sauelMjHqPBQLmoCqSiJF1M+3TyIWfmCwl9e0iEiT1xy9FykL6I1tFOHiudcNGUjWSD0 o5NESbgPsEVBqDmoiM9nJ0lpHn80rnERcAs0I4aJKmNY1luxRm9Bt9cSV/aZhTEfwIne qjoqa4mh1huj+s1xkpUkjWRsuowOrwK/veQAnqf2y0RtCOy94kBNSIqjgtieh5t46ojB PzLXA66e/sVzrZjgtb427vTWJVwEeD2ZZiz50jvYox3Mn99XvilLmxaTEq/74YgKlbGi coBQ== X-Gm-Message-State: ALoCoQlnwaB0Buk/B1KHlskOlt0OV7LG/D5fC61DZKUI6gT0G4M04iQ3EWR+tcCJ4QCELDzSRtejdUOJsRezyY8S4bnNJnKyr0b+EvLOGNXHm8TMQDnEWZ6gX5yEmDbUtrbhpQAqtI/z X-Received: by 10.224.87.138 with SMTP id w10mr5276198qal.79.1423208246019; Thu, 05 Feb 2015 23:37:26 -0800 (PST) MIME-Version: 1.0 Received: by 10.96.215.36 with HTTP; Thu, 5 Feb 2015 23:37:10 -0800 (PST) In-Reply-To: <54D46DA9.5000303@selasky.org> References: <54D3E995.9050205@selasky.org> <54D46DA9.5000303@selasky.org> From: "Lundberg, Johannes" Date: Fri, 6 Feb 2015 16:37:10 +0900 Message-ID: Subject: Re: Macbook touchpad wsp To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "freebsd-usb@freebsd.org" X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2015 07:37:33 -0000 VGhpcyBpcyB3aGF0IEkgc2FpZCBpbiBlYXJsaWVyIG1haWwuIEkgY29uZmlybWVkIHRoYXQgdGhl IGRldmljZSBpcyBsaXN0ZWQNCmluIHdzcC5jIGFuZCBhbHNvIGluIGRldmQvdXNiLmNvbmYgaW4g d3NwIHNlY3Rpb24uDQoNCnVzYmRldnM6DQoNCjExMjYgPGh0dHA6Ly9jb2RlLm1ldGFnZXIuZGUv c291cmNlL3hyZWYvZnJlZWJzZC9zeXMvZGV2L3VzYi91c2JkZXZzIzExMjY+LyoNCk1hY2Jvb2tB aXI2LDIgKHVuaWJvZHksIEp1bmUgMjAxMykgKi8xMTI3DQo8aHR0cDovL2NvZGUubWV0YWdlci5k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eeUqOOAgeOBvuOBn+OBr+iomOi8ieWGheWuueOBq+WfuuOBpeOBj+OBhOOBi+OBquOCi+ih jOWLleOCguOBleOCjOOBquOBhOOCiOOBhuOBiumhmOOBhOeUs+OBl+S4iuOBkuOBvuOBmeOAggot LS0KQ09ORklERU5USUFMSVRZIE5PVEU6IFRoZSBpbmZvcm1hdGlvbiBpbiB0aGlzIGVtYWlsIGlz IGNvbmZpZGVudGlhbAphbmQgaW50ZW5kZWQgc29sZWx5IGZvciB0aGUgYWRkcmVzc2VlLgpEaXNj bG9zdXJlLCBjb3B5aW5nLCBkaXN0cmlidXRpb24gb3IgYW55IG90aGVyIGFjdGlvbiBvZiB1c2Ug b2YgdGhpcwplbWFpbCBieSBwZXJzb24gb3RoZXIgdGhhbiBpbnRlbmRlZCByZWNpcGllbnQsIGlz IHByb2hpYml0ZWQuCklmIHlvdSBhcmUgbm90IHRoZSBpbnRlbmRlZCByZWNpcGllbnQgYW5kIGhh dmUgcmVjZWl2ZWQgdGhpcyBlbWFpbCBpbgplcnJvciwgcGxlYXNlIGRlc3Ryb3kgdGhlIG9yaWdp bmFsIG1lc3NhZ2UuCg== From owner-freebsd-usb@FreeBSD.ORG Fri Feb 6 08:01:57 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D7E0954 for ; Fri, 6 Feb 2015 08:01:57 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A6128BE for ; Fri, 6 Feb 2015 08:01:57 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id A48501FE023; Fri, 6 Feb 2015 09:01:54 +0100 (CET) Message-ID: <54D47524.9010300@selasky.org> Date: Fri, 06 Feb 2015 09:02:44 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: "Lundberg, Johannes" Subject: Re: Macbook touchpad wsp References: <54D3E995.9050205@selasky.org> <54D46DA9.5000303@selasky.org> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "freebsd-usb@freebsd.org" X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2015 08:01:57 -0000 Right, so maybe you need to update /etc/devd/usb.conf or make sure that wsp is loaded in /boot/loader.conf, so that other drivers don't grab the device! --HPS From owner-freebsd-usb@FreeBSD.ORG Fri Feb 6 08:04:24 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A4F3C09 for ; Fri, 6 Feb 2015 08:04:24 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9D458CB for ; Fri, 6 Feb 2015 08:04:23 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 6D4F61FE023; Fri, 6 Feb 2015 09:04:20 +0100 (CET) Message-ID: <54D475B7.2050208@selasky.org> Date: Fri, 06 Feb 2015 09:05:11 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: "Lundberg, Johannes" Subject: Re: Macbook touchpad wsp References: <54D3E995.9050205@selasky.org> <54D46DA9.5000303@selasky.org> <54D47524.9010300@selasky.org> In-Reply-To: <54D47524.9010300@selasky.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: "freebsd-usb@freebsd.org" X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2015 08:04:24 -0000 On 02/06/15 09:02, Hans Petter Selasky wrote: > Right, so maybe you need to update /etc/devd/usb.conf or make sure that > wsp is loaded in /boot/loader.conf, so that other drivers don't grab the > device! > Also check that moused is loaded for /dev/wsp0 . --HPS From owner-freebsd-usb@FreeBSD.ORG Fri Feb 6 08:11:32 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45867EC for ; Fri, 6 Feb 2015 08:11:32 +0000 (UTC) Received: from mail-qc0-f174.google.com (mail-qc0-f174.google.com [209.85.216.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 003F290D for ; Fri, 6 Feb 2015 08:11:31 +0000 (UTC) Received: by mail-qc0-f174.google.com with SMTP id s11so10611516qcv.5 for ; Fri, 06 Feb 2015 00:11:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=dRF5ryeI0Rb/FfWg9yp5uMEDVQryRXJpmx5OFG9MOdQ=; b=NtrScet3YMgu9J0OR2YnCfUPf/4/tyhVBovuB0hM14Np2zEPcyaf0x/5/nB70E6xH/ dv+eWVJp0BtKEw6v28wCjjs6hvCbHADMSSJJv+fS0g4meHgbd07+lUsAIi6KqglJXN12 xHB9Y/m9NxE7nVQ/gdLXj3vt+z5e7c/h03KsJ4hFmj3aYvTFpZ2zPUpL8FASYKS5TpDE Sq7r6g9d3TrHXd54eVvJGbZ2d2th7+VQIfFfEgtJs14RWK5t+cuHEg4Upute/gZval6L hWAT9NDDZLSnw3N7cgFTwfix5+o+Lm2n4X5Q6yGAH58B0us01sMFLGmy6ZVyTYjo5DqT 2Ybg== X-Gm-Message-State: ALoCoQnPSl4J0HiMtk3GZSUUrtPYB+mWpz9Uh+maFtFJeWvUffDgR6SabbY4wwr+4I9UFex/d6RdZeetpWF0FHxj1RAazGiNoS/s2LWEWLIv7Xitc8kDWwj/0xZjRY5QbhAAgTsljPxC X-Received: by 10.229.65.133 with SMTP id j5mr5556056qci.27.1423210290747; Fri, 06 Feb 2015 00:11:30 -0800 (PST) MIME-Version: 1.0 Received: by 10.96.215.36 with HTTP; Fri, 6 Feb 2015 00:11:15 -0800 (PST) In-Reply-To: <54D475B7.2050208@selasky.org> References: <54D3E995.9050205@selasky.org> <54D46DA9.5000303@selasky.org> <54D47524.9010300@selasky.org> <54D475B7.2050208@selasky.org> From: "Lundberg, Johannes" Date: Fri, 6 Feb 2015 17:11:15 +0900 Message-ID: Subject: Re: Macbook touchpad wsp To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "freebsd-usb@freebsd.org" X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2015 08:11:32 -0000 VGhlIHdlaXJkIHRoaW5nIGlzIHRoYXQgdGhpcyB1c2VkIHRvIHdvcmsgb3V0IG9mIHRoZSBib3gg YSB3aGlsZSBhZ28uIEkNCmV2ZW4gcmVtb3ZlZCB1bXMua28gZnJvbSBrZXJuZWwgZm9sZGVyIGFu ZCBhZGRlZCB3c3AgdG8gbG9hZGVyLmNvbmYgYnV0IGl0DQpkb2VzIG5vdCBtYXR0ZXIuLiB3c3Ag c2ltcGxlIHdvbid0IGF0dGFjaC4uIEkgaGF2ZW4ndCBtYWRlIGFueSBjaGFuZ2VzIGluDQpzcmMv LiAvZXRjL2RldmQvdXNiLmNvbmYgaXMgY29ycmVjdCBpbiB0aGUgbGF0ZXN0IHNuYXBzaG90IG1l bXN0aWNrIGltYWdlLg0KDQpBbnl3YXksIG5vdyBJIGtub3cgdGhlcmUncyBubyBrbm93biBwcm9i bGVtLiBJIHRyeSBsb29rIG1vcmUgaW50byBpdCB0bXJ3DQpzZWUgaWYgSSBjYW4gcGlucG9pbnQg d2hlcmUgaXQgZmFpbHMuDQoNCi0tDQpKb2hhbm5lcyBMdW5kYmVyZw0KQlJJTExJQU5UU0VSVklD RSBDTy4sIExURC4NCg0KT24gRnJpLCBGZWIgNiwgMjAxNSBhdCA1OjA1IFBNLCBIYW5zIFBldHRl ciBTZWxhc2t5IDxocHNAc2VsYXNreS5vcmc+IHdyb3RlOg0KDQo+IE9uIDAyLzA2LzE1IDA5OjAy LCBIYW5zIFBldHRlciBTZWxhc2t5IHdyb3RlOg0KPg0KPj4gUmlnaHQsIHNvIG1heWJlIHlvdSBu ZWVkIHRvIHVwZGF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zY2xvc3VyZSwgY29weWluZywgZGlzdHJp YnV0aW9uIG9yIGFueSBvdGhlciBhY3Rpb24gb2YgdXNlIG9mIHRoaXMKZW1haWwgYnkgcGVyc29u IG90aGVyIHRoYW4gaW50ZW5kZWQgcmVjaXBpZW50LCBpcyBwcm9oaWJpdGVkLgpJZiB5b3UgYXJl IG5vdCB0aGUgaW50ZW5kZWQgcmVjaXBpZW50IGFuZCBoYXZlIHJlY2VpdmVkIHRoaXMgZW1haWwg aW4KZXJyb3IsIHBsZWFzZSBkZXN0cm95IHRoZSBvcmlnaW5hbCBtZXNzYWdlLgo= From owner-freebsd-usb@FreeBSD.ORG Fri Feb 6 11:55:26 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E0396861; Fri, 6 Feb 2015 11:55:26 +0000 (UTC) Received: from pzwet.vanderzwet.net (pzwet.vanderzwet.net [IPv6:2a01:4f8:190:8221::1:1]) by mx1.freebsd.org (Postfix) with ESMTP id A20463CB; Fri, 6 Feb 2015 11:55:26 +0000 (UTC) Received: from [IPv6:2001:1af8:febe:0:b6b6:76ff:fe4f:1cd5] (unknown [IPv6:2001:1af8:febe:0:b6b6:76ff:fe4f:1cd5]) by pzwet.vanderzwet.net (Postfix) with ESMTPSA id 86022AF2BE6; Fri, 6 Feb 2015 11:55:14 +0000 (UTC) Message-ID: <54D4ABA2.2090109@rickvanderzwet.nl> Date: Fri, 06 Feb 2015 12:55:14 +0100 From: Rick van der Zwet User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Kevin Lo Subject: Re: Realtek RTL8152 driver attempt References: <54D32724.60307@rickvanderzwet.nl> <20150205153355.GA85786@ns.kevlo.org> In-Reply-To: <20150205153355.GA85786@ns.kevlo.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pzwet.vanderzwet.net Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2015 11:55:27 -0000 On 05/02/15 16:33, Kevin Lo wrote: > On Thu, Feb 05, 2015 at 09:17:40AM +0100, Rick van der Zwet wrote: >> >> Hi Folks, > > Hi Rick, > >> I have been trying to write a FreeBSD driver (if_rtl) for the Realtek >> RTL8152 chipset, which is a USB to Ethernet dongle (using the Sitecom >> LN-030 v3). > > What a coincidence. I've been slowly working on porting r8152 driver from > Linux to FreeBSD since last month. Nice! >> Looking at the if_rue(4) and the linux r8152.c code, basically I got >> this far in porting but yet no working code: >> https://rickvanderzwet.nl/svn/personal/freebsd-rtl-driver/ >> >> There are no bulk out and in packets passing trough, so I am basically >> stuck now, not knowing how-to continue this journey. Could anybody give >> me an hint on how-to get this train going again? > > Mine basically is working but needs serious cleanup and bug fixes. > http://people.freebsd.org/~kevlo/ure.diff > > Please let me know if it works for you, thanks. I have been trying it in VirtualBox and basic I/O works. It really does not like to be stressed. Running an `ping -f` or iperf kills the driver saying 'ure0: PHY read failed'. Will try to get some real hardware setup to see if it makes any difference. Best regards, /Rick From owner-freebsd-usb@FreeBSD.ORG Sat Feb 7 15:20:18 2015 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7079FC36; Sat, 7 Feb 2015 15:20:18 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11A6E26F; Sat, 7 Feb 2015 15:20:14 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id C156F1FE023; Sat, 7 Feb 2015 16:20:11 +0100 (CET) Message-ID: <54D62D5D.2000201@selasky.org> Date: Sat, 07 Feb 2015 16:21:01 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: freebsd-usb@freebsd.org, freebsd-multimedia@FreeBSD.org Subject: USB audio patch Content-Type: multipart/mixed; boundary="------------080502000008090701010708" X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2015 15:20:18 -0000 This is a multi-part message in MIME format. --------------080502000008090701010708 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi, If you have a USB audio device which uses the feedback endpoint, where the sample rate is not locked to the USB, you may want to try the attached patch. I will test it a bit more and then it will hit the tree next week. The basic of the change is to reduce the number of sample rate adjustments. Some devices only update the sample rate very slowly, and the current USB audio driver is polling very fast, so the algorithm simply becomes unreliable with some kinds of USB audio devices. --HPS --------------080502000008090701010708 Content-Type: text/x-patch; name="uaudio.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="uaudio.patch" Index: sys/dev/sound/usb/uaudio.c =================================================================== --- sys/dev/sound/usb/uaudio.c (revision 278206) +++ sys/dev/sound/usb/uaudio.c (working copy) @@ -111,6 +111,7 @@ &uaudio_default_channels, 0, "uaudio default sample channels"); #endif +#define UAUDIO_IRQS (8000 / UAUDIO_NFRAMES) /* interrupts per second */ #define UAUDIO_NFRAMES 64 /* must be factor of 8 due HS-USB */ #define UAUDIO_NCHANBUFS 2 /* number of outstanding request */ #define UAUDIO_RECURSE_LIMIT 255 /* rounds */ @@ -189,7 +190,6 @@ uint8_t iface_index; uint8_t iface_alt_index; uint8_t channels; - uint8_t enable_sync; }; struct uaudio_chan { @@ -226,11 +226,10 @@ #define CHAN_OP_STOP 2 #define CHAN_OP_DRAIN 3 - uint8_t last_sync_time; - uint8_t last_sync_state; -#define UAUDIO_SYNC_NONE 0 -#define UAUDIO_SYNC_MORE 1 -#define UAUDIO_SYNC_LESS 2 + /* USB audio feedback endpoint state */ + int16_t last_sync_time; + int16_t last_sync_constant; /* sample rate adjustment in Hz */ + int16_t last_sync_remainder; }; #define UMIDI_EMB_JACK_MAX 16 /* units */ @@ -1799,14 +1798,6 @@ chan_alt->iface_index = curidx; chan_alt->iface_alt_index = alt_index; - if (UEP_HAS_SYNCADDR(ed1) && ed1->bSynchAddress != 0) { - DPRINTF("Sync endpoint will be used, if present\n"); - chan_alt->enable_sync = 1; - } else { - DPRINTF("Sync endpoint will not be used\n"); - chan_alt->enable_sync = 0; - } - usbd_set_parent_iface(sc->sc_udev, curidx, sc->sc_mixer_iface_index); @@ -2028,17 +2019,21 @@ while (temp > (sample_rate + (sample_rate / 2))) temp /= 2; - /* compare */ - DPRINTF("Comparing %d < %d\n", (int)temp, (int)sample_rate); - if (temp == sample_rate) - ch->last_sync_state = UAUDIO_SYNC_NONE; - else if (temp > sample_rate) - ch->last_sync_state = UAUDIO_SYNC_MORE; - else - ch->last_sync_state = UAUDIO_SYNC_LESS; + /* Update sync constant */ + ch->last_sync_constant += (temp - sample_rate); + + /* + * Range check sync constant. We cannot change the + * number of samples per second by more than the value + * defined by "UAUDIO_IRQS": + */ + if (ch->last_sync_constant > UAUDIO_IRQS) + ch->last_sync_constant = UAUDIO_IRQS; + else if (ch->last_sync_constant < -UAUDIO_IRQS) + ch->last_sync_constant = -UAUDIO_IRQS; break; case USB_ST_SETUP: @@ -2082,10 +2077,10 @@ } chn_intr(ch->pcm_ch); - /* start SYNC transfer, if any */ - if (ch->usb_alt[ch->cur_alt].enable_sync != 0) { - if ((ch->last_sync_time++ & 7) == 0) - usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]); + /* start the SYNC transfer one time per second, if any */ + if (++(ch->last_sync_time) >= UAUDIO_IRQS) { + ch->last_sync_time = 0; + usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]); } case USB_ST_SETUP: @@ -2120,21 +2115,22 @@ } if (n == (blockcount - 1)) { - switch (ch->last_sync_state) { - case UAUDIO_SYNC_MORE: + /* + * Update sync remainder and check if + * we should transmit more or less + * data: + */ + ch->last_sync_remainder += ch->last_sync_constant; + if (ch->last_sync_remainder >= UAUDIO_IRQS) { + ch->last_sync_remainder -= UAUDIO_IRQS; DPRINTFN(6, "sending one sample more\n"); if ((frame_len + sample_size) <= mfl) frame_len += sample_size; - ch->last_sync_state = UAUDIO_SYNC_NONE; - break; - case UAUDIO_SYNC_LESS: + } else if (ch->last_sync_remainder <= -UAUDIO_IRQS) { + ch->last_sync_remainder += UAUDIO_IRQS; DPRINTFN(6, "sending one sample less\n"); if (frame_len >= sample_size) frame_len -= sample_size; - ch->last_sync_state = UAUDIO_SYNC_NONE; - break; - default: - break; } } --------------080502000008090701010708--