From owner-freebsd-wireless@freebsd.org Wed Aug 14 04:10:07 2019 Return-Path: Delivered-To: freebsd-wireless@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B354C5F9F for ; Wed, 14 Aug 2019 04:10:07 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-yw1-xc2b.google.com (mail-yw1-xc2b.google.com [IPv6:2607:f8b0:4864:20::c2b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 467bhZ2hDjz3HLH for ; Wed, 14 Aug 2019 04:10:06 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-yw1-xc2b.google.com with SMTP id x74so22566892ywx.6 for ; Tue, 13 Aug 2019 21:10:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4QNLY4Boh3gWu/1Vm0r2HySqyOsflIRrb4o8emkDoWw=; b=BhRm7xfwNqoyjHMB4hAnQl5FZ77h2jjlFn596MCREMwRnClvzkax6ZY68c0IAt39s3 OD9ZNnIinDyZB0b1I9GIO+uIxmismNa3UYIT3z+YBfGaaX0j6ey0D503IM/Ryl41Rok8 cnGZ2QosN/Cbq2ekx3klUFiWuDRhRrKLwGoUIY6IJpbzeyXRzawbxdcqOfoCGaRUADn4 PwIyntOo3CP5zL/6bJDXJL3Nltz7/3IkNwJ1Em0l+2vgOMfTz6qPAzR1xUM288gj+2kX xPeUknEexKH9vWiAXMk9kyawRINApYX+d4cL9h7FyurdEVmIkuuOESBJJ6aY4dFeqMBc R8jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4QNLY4Boh3gWu/1Vm0r2HySqyOsflIRrb4o8emkDoWw=; b=LoYyZPWU6UummX8g4gUL6yflTgyTxmnTi2yN9u1sRoDObGMXGyrWAY15M1Tf7Kh/L3 vq3ptfgdGazjoVO24/orXblBjY1tA+lHnAdRNTBHrV1kVRFbc4Trt3Ggt2x4DxwOGR/a bQmzfg5FjO+mbbvfkVe5rAbEzen7XnkObGzFixKhAXzE8vUFkRUVJJDY7bWCwO2t8v4d rBPgeLZdHUpqoPHjHwUcpJDchBE8gWT1eqrVwOU8qbAm8sL6VJLW/6dgNhPFQ1iWFkkf YH6x4solcqezZrAHGNjgNjprLxJnBsdxyvq24vS+vlr3wbwd09jYS/W/7VW72aTxnvZd c69g== X-Gm-Message-State: APjAAAWBn8l26i4AAgEb/gElXt6jDhbkAizcJmKA/W1Tp8Z39+iBd4HH GRpTUrXDoRGeKoHBnJVru8qVICGTXfPL9fT6nZ4= X-Google-Smtp-Source: APXvYqyjRg6oUcOrdUTi/Yz+NkO14wyXNDhMI1aZYVm1Z1VBobgek8yNsxHVbkRRU2fFkmbfPtUCjxzF5p8481uQm3I= X-Received: by 2002:a81:3109:: with SMTP id x9mr21195191ywx.386.1565755805070; Tue, 13 Aug 2019 21:10:05 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Adrian Chadd Date: Tue, 13 Aug 2019 21:09:52 -0700 Message-ID: Subject: Re: rtwn driver To: "james.m.parsons" Cc: "freebsd-wireless@freebsd.org" X-Rspamd-Queue-Id: 467bhZ2hDjz3HLH X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=BhRm7xfw; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of adrianchadd@gmail.com designates 2607:f8b0:4864:20::c2b as permitted sender) smtp.mailfrom=adrianchadd@gmail.com X-Spamd-Result: default: False [-4.00 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-0.998,0]; FREEMAIL_TO(0.00)[protonmail.com]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.00)[ip: (-9.45), ipnet: 2607:f8b0::/32(-2.98), asn: 15169(-2.39), country: US(-0.05)]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-wireless@freebsd.org]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[b.2.c.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Aug 2019 04:10:07 -0000 hi! Thanks for doing this! if it's the same chipset but a different ID then yes, it's literally that easy most times. :) Nice work! If you file a PR then we'll try to get someone to commit it to freebsd-head. -a On Sun, 11 Aug 2019 at 00:34, james.m.parsons via freebsd-wireless < freebsd-wireless@freebsd.org> wrote: > Good morning, > > A few weeks ago, I installed FreeBSD 12.0-RELEASE on a box that had an > [Asus PCE-N15](https://www.asus.com/us/Networking/PCEN15/) wireless > network card based on the Realtek RTL8192CE chipset. According to the man > page for the [rtwn]( > https://www.freebsd.org/cgi/man.cgi?query=rtwn&sektion=4&manpath=freebsd-release-ports) > driver, this card was supported, however the driver refused to attach. > Running pciconf -lv would show the device as none0, but had the correct > vendor information. > > Later on, after [inquiring on the forums]( > https://forums.freebsd.org/threads/issue-getting-realtek-wireless-network-card-rtwn-driver-working-on-new-freebsd-installation.71677/), > I decided to investigate the potential of patching the driver to work with > my card. When I finally sat down tonight to start on it, I found the fix > surprisingly simple. Looking at the driver source code under > /sys/dev/rtwn/pci/rtwn_pci_attach.h, I see an array containing the vendor > id's and device id's for PCI devices: > > static const struct rtwn_pci_ident rtwn_pci_ident_table[] = { > { 0x10ec, 0x8176, "Realtek RTL8188CE", RTWN_CHIP_RTL8192CE }, > { 0, 0, NULL, RTWN_CHIP_MAX_PCI } > }; > > I noticed the device id 0x8176 was different from my card, which was > reported as 0x8178. So I added to that array: > > { 0x10ec, 0x8178, "Realtek RTL8192CE", RTWN_CHIP_RTL8192CE }, > > And after building and installing a custom kernel with all the lines noted > in the above man page to the config, I rebooted, noticed the driver is now > attaching to the PCI device and have since been able to connect to my home > wifi without issue. > > Honestly, I'm a bit suspicious at the ease of fixing this issue, and am > not sure if this is something that should / could be contributed to the > kernel code. I'm also sure, there are other device id's that would need > added to have full support, but after asking some other people, I was > suggested to send an email to this address. > > Thanks, > James Parsons > _______________________________________________ > freebsd-wireless@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-wireless > To unsubscribe, send any mail to "freebsd-wireless-unsubscribe@freebsd.org > " >