9front - general discussion about 9front
 help / color / mirror / Atom feed
From: cinap_lenrek@felloff.net
To: 9front@9front.org
Subject: Re: [9front] Hardware woes
Date: Fri, 1 Jul 2016 12:27:19 +0200	[thread overview]
Message-ID: <1b7f4590bc4b19ce8253e6373f2ff7d9@felloff.net> (raw)
In-Reply-To: <CAG2UyHobLtN4TzWr8QZZeW4KezxYjK5C-oQizzz-AUiqDMEK6g@mail.gmail.com>

> 1. I've got one of these:
> http://www.canakit.com/raspberry-pi-wifi.html gathering dust on a
> shelf. The firmware in Linux is rt2870.bin (despite the chipset being
> 5390) and I noticed in /sys/src/9/pc/etherrt2860.c there's some code
> about 2870, so figured there's a chance it'll just work. I plugged it
> in and it's not even generating an event in /dev/usbevent. I know the
> USB port works, because it's the same one I used to copy the firmware
> into /lib/firmware. What would stop it from even noticing that the
> dongle was plugged in?

the etherrt2860.c is driver for a pci card. usb drivers run in userspace.
so would need to port the wifi stack to userspace and make a usb driver.

> 2. I decided to look into the difference between the iwm driver from
> OpenBSD (https://github.com/rpaulo/iwm/blob/master/driver/if_iwmreg.h)
> and iwl from 9front
> (http://www.9front.org/9front/sys/src/9/pc/etheriwl.c). From what I
> can tell, every register and offset I compared seemed to have the same
> format, so I'm tempted to just add the type to fwname[] and see what
> happens. If that works, it'll be better than being forced to have a
> usb port.. but I don't know how to figure out the ID for the type to
> add to the enum above it. I added a print statement to setfwinfo() and
> added ether0=type=iwl to my plan9.ini, but it doesn't seem to be
> making it there. Is there something else I need to do to force the
> driver or an easier way to probe the id?

see iwlpci() function:

		switch(pdev->did){
		default:
			continue;
		case 0x0084:	/* WiFi Link 1000 */
		case 0x4229:	/* WiFi Link 4965 */
		case 0x4230:	/* WiFi Link 4965 */
		case 0x4232:	/* Wifi Link 5100 */
		case 0x4236:	/* WiFi Link 5300 AGN */
		case 0x4237:	/* Wifi Link 5100 AGN */
		case 0x423d:	/* Wifi Link 5150 */
		case 0x423b:	/* PRO/Wireless 5350 AGN */
		case 0x0082:	/* Centrino Advanced-N 6205 */
		case 0x0085:	/* Centrino Advanced-N 6205 */
		case 0x422b:	/* Centrino Ultimate-N 6300 variant 1 */
		case 0x4238:	/* Centrino Ultimate-N 6300 variant 2 */
		case 0x08ae:	/* Centrino Wireless-N 100 */
		case 0x0083:	/* Centrino Wireless-N 1000 */
		case 0x0887:	/* Centrino Wireless-N 2230 */
		case 0x0888:	/* Centrino Wireless-N 2230 */
			break;
		}

the device type is read from pci config space Rev register:

		ctlr->type = (csr32r(ctlr, Rev) >> 4) & 0xF;

the differences are distinguished by that field, like
the firmware name is indexed by that:

		fw = readfirmware(fwname[ctlr->type]);

--
cinap


  reply	other threads:[~2016-07-01 10:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-27 21:53 Dave MacFarlane
2016-06-27 23:31 ` [9front] " kokamoto
2016-06-27 23:45   ` Dave MacFarlane
2016-06-28  0:48 ` cinap_lenrek
2016-06-28 23:56   ` Dave MacFarlane
2016-06-29  0:00     ` Dave MacFarlane
2016-06-29  7:13     ` cinap_lenrek
2016-06-29 14:18       ` Dave MacFarlane
2016-06-29 15:24         ` stanley lieber
2016-06-29 15:49         ` cinap_lenrek
2016-06-29 23:45           ` Dave MacFarlane
2016-06-30  0:05             ` cinap_lenrek
2016-07-01  0:45               ` Dave MacFarlane
2016-07-01 10:27                 ` cinap_lenrek [this message]
2016-07-01 20:42                   ` Dave MacFarlane
2016-07-01 21:11                     ` cinap_lenrek
2016-07-03 22:55                   ` Dave MacFarlane

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1b7f4590bc4b19ce8253e6373f2ff7d9@felloff.net \
    --to=cinap_lenrek@felloff.net \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).