From owner-freebsd-net@FreeBSD.ORG Wed Jun 3 15:42:29 2015 Return-Path: Delivered-To: freebsd-net@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 CF51980E for ; Wed, 3 Jun 2015 15:42:29 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) (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 70B861906 for ; Wed, 3 Jun 2015 15:42:29 +0000 (UTC) (envelope-from woodsb02@gmail.com) Received: by wibdt2 with SMTP id dt2so18021372wib.1 for ; Wed, 03 Jun 2015 08:42:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=55bj6YbxCNA2Rsme4bAFs2RMMhrKGpw8hyXdJ1cGdXM=; b=WoggsD9wpVZq1z9gktOdyyakNAkrgFeRZhPVBz7CV4qRSWQFvfaLdxvyQN7z42mV1s zpLT1lceN5mWOFXiUVfU9JlOFLpBDXLNXqMel06cDFYrAr6bQ2KjBqicbliDs4ng+uJq c5ppJNaKuiMVi6b0kmevphYUB1hYXadkdItXx3HYUmtNUy+WRuXn4RzR4HGhn4aZFSNf Zj+qRUtOcA2sDxDI2aTZCq8fGv8ky8EF8HLFZ0zi1N7hiI45ztJL57fZTAPkUKAiFDtT r8dQf6gH5kkONldtc7NAQdOQJKpyHgRu+SBn138Il+F0oT299qbYSNcvA5MBi7cZ3d6Q 4JGw== MIME-Version: 1.0 X-Received: by 10.180.94.39 with SMTP id cz7mr41857590wib.66.1433346147970; Wed, 03 Jun 2015 08:42:27 -0700 (PDT) Received: by 10.28.61.215 with HTTP; Wed, 3 Jun 2015 08:42:27 -0700 (PDT) In-Reply-To: <556F1AC7.3030505@selasky.org> References: <556F1AC7.3030505@selasky.org> Date: Wed, 3 Jun 2015 23:42:27 +0800 Message-ID: Subject: Re: Adding RTL8153 support to rue(4) USB to Ethernet driver From: Ben Woods To: Hans Petter Selasky Cc: freebsd-net@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2015 15:42:30 -0000 On 3 June 2015 at 23:18, Hans Petter Selasky wrote: > On 06/03/15 17:01, Ben Woods wrote: >> >> On 3 June 2015 at 22:59, Ben Woods wrote: >>> >>> Hi everyone, >>> >>> I am wondering what it would take to add support for RTL8153 to the >>> rue(4) USB to Fast Ethernet driver for Realtek. >>> >>> I bought one of these from NEC in Japan (their part number >>> PC-VP-BK06), as shown here (use Google translate): >>> http://121ware.com/product/option/cable/pc-vp-bk06/index.html >>> >>> Here is the diff when support was added to the Linux kernel: >>> https://lkml.org/lkml/2013/7/7/127 >>> >>> Regards, >>> Ben >>> >>> -- >>> From: Benjamin Woods >>> woodsb02@gmail.com >> >> >> I nearly forgot the output from my usbconfig(8): >> >> # usbconfig -u 1 -a 2 dump_device_desc >> ugen1.5: 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 = 0x8153 >> bcdDevice = 0x3000 >> iManufacturer = 0x0001 >> iProduct = 0x0002 >> iSerialNumber = 0x0003 <9CEBE81A1976> >> bNumConfigurations = 0x0002 >> >> Regards, >> Ben > > > Hi, > > Can you dump the configuration descriptors? > > Have you tried: > > usbconfig -d X.Y set_config 1 > > --HPS > Wow - it works after running your recommended "usbconfig -d X.Y set_config 1"! It shows up as interface ue0, I can get an IP address with DHCLIENT and networking works fine. Note that I am running FreeBSD 11-current r283879. Thank you for your help HPS! How can we make this work out of the box in the future? Here is the dmesg output: kernel: ugen0.3: at usbus0 root: Unknown USB device: vendor 0x0bda product 0x8153 bus uhub0 kernel: cdce0: on usbus0 kernel: ue0: on cdce0 kernel: ue0: Ethernet address: 9c:eb:e8:1a:19:76 root: Unknown USB device: vendor 0x0bda product 0x8153 bus uhub0 root: Unknown USB device: vendor 0x064e product 0xc801 bus uhub0 root: Unknown USB device: vendor 0x064e product 0xc801 bus uhub0 Here is a copy of the configuration descriptors BEFORE running the above command: ugen0.3: at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON (36mA) Configuration index 0 bLength = 0x0009 bDescriptorType = 0x0002 wTotalLength = 0x0039 bNumInterfaces = 0x0001 bConfigurationValue = 0x0001 iConfiguration = 0x0000 bmAttributes = 0x00a0 bMaxPower = 0x0012 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 = 0x0400 bInterval = 0x0000 bRefresh = 0x0000 bSynchAddress = 0x0000 Additional Descriptor bLength = 0x06 bDescriptorType = 0x30 bDescriptorSubType = 0x03 RAW dump: 0x00 | 0x06, 0x30, 0x03, 0x00, 0x00, 0x00 Endpoint 1 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0002 bmAttributes = 0x0002 wMaxPacketSize = 0x0400 bInterval = 0x0000 bRefresh = 0x0000 bSynchAddress = 0x0000 Additional Descriptor bLength = 0x06 bDescriptorType = 0x30 bDescriptorSubType = 0x03 RAW dump: 0x00 | 0x06, 0x30, 0x03, 0x00, 0x00, 0x00 Endpoint 2 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0083 bmAttributes = 0x0003 wMaxPacketSize = 0x0002 bInterval = 0x0008 bRefresh = 0x0000 bSynchAddress = 0x0000 Additional Descriptor bLength = 0x06 bDescriptorType = 0x30 bDescriptorSubType = 0x00 RAW dump: 0x00 | 0x06, 0x30, 0x00, 0x00, 0x02, 0x00 Here is a copy of the configuration descriptors AFTER running the command: ugen0.3: at usbus0, cfg=1 md=HOST spd=SUPER (5.0Gbps) pwr=ON (36mA) Configuration index 1 bLength = 0x0009 bDescriptorType = 0x0002 wTotalLength = 0x0062 bNumInterfaces = 0x0002 bConfigurationValue = 0x0002 iConfiguration = 0x0000 bmAttributes = 0x00a0 bMaxPower = 0x0012 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 Additional Descriptor bLength = 0x06 bDescriptorType = 0x30 bDescriptorSubType = 0x00 RAW dump: 0x00 | 0x06, 0x30, 0x00, 0x00, 0x08, 0x00 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 = 0x0400 bInterval = 0x0000 bRefresh = 0x0000 bSynchAddress = 0x0000 Additional Descriptor bLength = 0x06 bDescriptorType = 0x30 bDescriptorSubType = 0x03 RAW dump: 0x00 | 0x06, 0x30, 0x03, 0x00, 0x00, 0x00 Endpoint 1 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0002 bmAttributes = 0x0002 wMaxPacketSize = 0x0400 bInterval = 0x0000 bRefresh = 0x0000 bSynchAddress = 0x0000 Additional Descriptor bLength = 0x06 bDescriptorType = 0x30 bDescriptorSubType = 0x03 RAW dump: 0x00 | 0x06, 0x30, 0x03, 0x00, 0x00, 0x00 Regards, Ben