From owner-freebsd-current@freebsd.org Sun Jan 28 13:28:23 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0DD2EC67C7 for ; Sun, 28 Jan 2018 13:28:22 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 83DF87B352 for ; Sun, 28 Jan 2018 13:28:21 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (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 5C151260077; Sun, 28 Jan 2018 14:28:17 +0100 (CET) Subject: Re: USB wifi dongle can't work To: KIRIYAMA Kazuhiko , freebsd-current@freebsd.org References: <201801280342.w0S3gKZ7023238@kx.openedu.org> From: Hans Petter Selasky Message-ID: <10c522c9-1a05-ce39-80ab-e60415e80d68@selasky.org> Date: Sun, 28 Jan 2018 14:25:22 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <201801280342.w0S3gKZ7023238@kx.openedu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jan 2018 13:28:23 -0000 On 01/28/18 04:42, KIRIYAMA Kazuhiko wrote: > Hi, > > I've tested a USB wifi dongle but can't work. It's usbconfig > is as follows: > > ugen0.2: at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (160mA) > > bLength = 0x0012 > bDescriptorType = 0x0001 > bcdUSB = 0x0201 > bDeviceClass = 0x0000 > bDeviceSubClass = 0x0000 > bDeviceProtocol = 0x0000 > bMaxPacketSize0 = 0x0040 > idVendor = 0x148f > idProduct = 0x7601 > bcdDevice = 0x0000 > iManufacturer = 0x0001 > iProduct = 0x0002 <802.11 n WLAN> > iSerialNumber = 0x0003 <1.0> > bNumConfigurations = 0x0001 > > So I tried to work with it by adding vendor entry to usbdevs > and if_run.c: > > --- sys/dev/usb/usbdevs.org 2018-01-27 16:00:48.963304000 +0900 > +++ sys/dev/usb/usbdevs 2018-01-27 17:23:53.341085000 +0900 > @@ -3845,6 +3845,7 @@ > product RALINK RT3573 0x3573 RT3573 > product RALINK RT5370 0x5370 RT5370 > product RALINK RT5572 0x5572 RT5572 > +product RALINK RT7601 0x7601 RT7601 > product RALINK RT8070 0x8070 RT8070 > product RALINK RT2570_3 0x9020 RT2500USB Wireless Adapter > product RALINK RT2573_2 0x9021 RT2501USB Wireless Adapter > --- sys/dev/usb/wlan/if_run.c.org 2018-01-27 17:25:50.504335000 +0900 > +++ sys/dev/usb/wlan/if_run.c 2018-01-27 17:29:29.438094000 +0900 > @@ -300,6 +300,7 @@ > RUN_DEV(RALINK, RT3573), > RUN_DEV(RALINK, RT5370), > RUN_DEV(RALINK, RT5572), > + RUN_DEV(RALINK, RT7601), > RUN_DEV(RALINK, RT8070), > RUN_DEV(SAMSUNG, WIS09ABGN), > RUN_DEV(SAMSUNG2, RT2870_1), > > and reconfigured kernel and set rc.conf: > > hostname="t.pis" > ifconfig_wlan0="DHCP mode 11n" > wlans_run0="wlan0" > saver="logo" > sendmail_enable="NONE" > sshd_enable="YES" > usbd_enable="YES" > ntpd_enable="YES" > > then rebooted. But can't start as DHCP client: > > admin@t:~ % ifconfig > lo0: flags=8049 metric 0 mtu 16384 > options=600003 > inet6 ::1 prefixlen 128 > inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 > inet 127.0.0.1 netmask 0xff000000 > nd6 options=21 > groups: lo > wlan0: flags=8843 metric 0 mtu 1500 > ether 00:0f:00:4a:7f:28 > nd6 options=29 > media: IEEE 802.11 Wireless Ethernet autoselect (autoselect) > status: no carrier > ssid "" channel 11 (2462 MHz 11g) > regdomain FCC country US authmode OPEN privacy OFF txpower 30 bmiss 7 > scanvalid 60 protmode CTS wme bintval 0 > groups: wlan > admin@t:~ % > > dmesg shows: > > ugen0.2: at usbus0 > run0 on uhub0 > run0: on usbus0 > run0: MAC/BBP RT7601 (rev 0x0500), RF RT5592 (MIMO 1T1R), address 00:0f:00:4a:7f:28 > wlan0: Ethernet address: 00:0f:00:4a:7f:28 > ugen0.3: at usbus0 > ukbd0 on uhub0 > ukbd0: on usbus0 > kbd2 at ukbd0 > ugen0.4: at usbus0 > ugen0.5: at usbus0 > run0: timeout waiting for MCU to initialize > run0: could not load 8051 microcode > > This means there is not a driver for RT7601? > > root@t:~ # uname -v > FreeBSD 12.0-CURRENT #0: Sat Jan 27 17:58:35 JST 2018 admin@lmainkx:/usr/obj/usr/src/amd64.amd64/sys/RT7601 > root@t:~ # > > and OS revision is r328126. > Is there any idea? > Hi, Try to search the Linux kernel code for idProduct and idVendor values in hexadecimal. You can't just add driver like that and it will work :-) --HPS