Discussion:
run(4) raspberry pi dongle
(too old to reply)
Patrick Welche
2017-01-13 10:15:24 UTC
Permalink
I've had a go at supporting a "Raspberry Pi USB WiFi Dongle", which in this
incarnation appears to be a

run0: Ralink 802.11 n WLAN, rev 2.00/1.01, addr 6
run0: MAC/BBP RT5390 (rev 0x0502), RF RT5370 (MIMO 1T1R), address 44:33:44:33:4f

(=> mac_ver = 0x5390)

It comes up with:

run0: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ssid ""
powersave off
address: 44:33:44:33:4f:a5
media: IEEE802.11 autoselect (DS1)
status: no network
inet6 fe80::4633:44ff:fe33:4fa5%run0/64 flags 0x0 scopeid 0x4

i.e., "microcode successfully loaded after 0 tries"

But then e.g., wanctl -a shows no networks:

run0: mac 44:33:44:33:4f:a5 bss 00:00:00:00:00:00
node flags 0001<bss>
ess <>
chan 0 freq 0MHz flags 0000
capabilities 0000
beacon-interval 0 TU tsft 0 us
rates [1.0] 2.0 5.5 11.0 6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.0
assoc-id 0 assoc-failed 0 inactivity 300s
rssi 0 txseq 14 rxseq 0

The only error I see is:

tx mixer gain=0 (2GHz) (Is zero bad?)
invalid LNA for channel group 2
invalid LNA for channel group 3

Is that just a warning or the error that needs fixing which will make
everything OK? (I think LNA = low-noise amplifier)

I have essentially been cargo-culting from OpenBSD/FreeBSD drivers - is
there some actual documentation?


I tried building a rump lib with the most basic cut and paste Makefile/ioconf
and hit:

multiple definition of `rumpns_run_cd'

I don't think I should have seen:

# nm -g obj.amd64/if_run.o | grep run_cd
0000000000000060 D rumpns_run_cd

if anyone has a quick suggestion?


Debug output, apart from the LNA seems OK?

run0 at uhub3 port 3
run0: Ralink 802.11 n WLAN, rev 2.00/1.01, addr 6
EFUSE_CTRL=0x80008800
EEPROM rev=112, FAE=83
EEPROM freq offset 0
EEPROM LED mode=0x01, LEDs=0x5555/0x2221/0x5627
EEPROM RF rev=0x5370 chains=1T1R
EEPROM CFG 0x0511
chan 1: power1=0, power2=0
chan 2: power1=0, power2=0
chan 3: power1=15, power2=0
chan 4: power1=16, power2=0
chan 5: power1=15, power2=0
chan 6: power1=16, power2=0
chan 7: power1=17, power2=0
chan 8: power1=17, power2=0
chan 9: power1=17, power2=0
chan 10: power1=17, power2=0
chan 11: power1=18, power2=0
chan 12: power1=18, power2=0
chan 13: power1=18, power2=0
chan 14: power1=18, power2=0
chan 36: power1=-1, power2=-1
...
chan 0: power1=-1, power2=-1
power compensation=0 (2GHz), 0 (5GHz)
ridx 0: power 20MHz=0xaaaa0000, 40MHz/2GHz=0xaaaa0000, 40MHz/5GHz=0xaaaa0000
ridx 1: power 20MHz=0xaaaaaaaa, 40MHz/2GHz=0xaaaaaaaa, 40MHz/5GHz=0xaaaaaaaa
ridx 2: power 20MHz=0xaaaaaaaa, 40MHz/2GHz=0xaaaaaaaa, 40MHz/5GHz=0xaaaaaaaa
ridx 3: power 20MHz=0xaaaaaaaa, 40MHz/2GHz=0xaaaaaaaa, 40MHz/5GHz=0xaaaaaaaa
ridx 4: power 20MHz=0xffffaaaa, 40MHz/2GHz=0xffffaaaa, 40MHz/5GHz=0xffffaaaa
tx mixer gain=0 (2GHz)
invalid LNA for channel group 2
invalid LNA for channel group 3
run0: MAC/BBP RT5390 (rev 0x0502), RF RT5370 (MIMO 1T1R), address 44:33:44:33:4f:a5
run0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
run0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
microcode successfully loaded after 0 tries



Cheers,

Patrick

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Patrick Welche
2017-01-19 08:05:31 UTC
Permalink
Post by Patrick Welche
I've had a go at supporting a "Raspberry Pi USB WiFi Dongle", which in this
incarnation appears to be a
run0: Ralink 802.11 n WLAN, rev 2.00/1.01, addr 6
run0: MAC/BBP RT5390 (rev 0x0502), RF RT5370 (MIMO 1T1R), address 44:33:44:33:4f
That Pi remained in Belgium, so attached is the patch I was using.
Changes to if_runvar.h from

https://mail-index.netbsd.org/tech-net/2015/09/12/msg005356.html

I think this fixes an error in the current NetBSD driver:

@@ -1629,7 +1665,7 @@
sc->lna[2] = val >> 8; /* channel group 2 */

run_srom_read(sc, (sc->mac_ver != 0x3593) ? RT2860_EEPROM_RSSI1_5GHZ :
- RT3593_EEPROM_RSSI2_5GHZ, &val);
+ RT3593_EEPROM_RSSI1_5GHZ, &val);
sc->rssi_5ghz[0] = val & 0xff; /* Ant A */
sc->rssi_5ghz[1] = val >> 8; /* Ant B */
run_srom_read(sc, (sc->mac_ver != 0x3593) ? RT2860_EEPROM_RSSI2_5GHZ :

I didn't get my run(4) device to work, but I wonder if this breaks
currently working ones...


Cheers,

Patrick

Loading...