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 LT0tPS09LT0tPS09LT0tPS09LT0tPS09LT0tP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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