kaloz / mwlwifi

mac80211 driver for the Marvell 88W8864 802.11ac chip
396 stars 119 forks source link

WDS support for Rango (WRT3200ACM) #182

Closed yuhhaurlin closed 6 years ago

yuhhaurlin commented 7 years ago

Support WDS via OpenWRT 4 address solution.

adamcarter1 commented 6 years ago

Regarding mu-mimo.

Would Be nice if it was done sooner.

Let me just ask this. Perhaps you can help me understand. The linksys wrt 32x uses a firmware loosely based on “open wrt”. Not a standard linksys firmware. Open wrt pretty much gave birth to lede, which you use to test all this stuff. The linksys 32x has mu-mimo. Ergo Can’t any of that info from the marvell people who made the driver or firmware or whatever for 32x, be usefull in getting it to work for dd-wrt and/ or lede.

Am i taking crazy pills?

yuhhaurlin commented 6 years ago

Sorry. I have no idea about wrt32x.

adamcarter1 commented 6 years ago

Sorry, wasn’t trying to be rude or pushy. i was under the assumption you work for marvell.

What i know about the 32x is this Their processor, a marvell processor, the same processor is in both the 3200acm and the 32x. The 32x uses an open wrt based firmware, they have things like mu-mimo working or at least thats what they claim on the box. If that is true, someone at marvell has already written the mu-mimo code for an open wrt based system with this processor. Why are we reinventing the wheel here.

If you do work for marvell. I’m not asking you to release sensitive wrt-32x information... just perhaps send a quick internal work email to colleagues who worked on the marvell driver for the 32x to get some of this stuff working.

I and others appreciate your time.

yuhhaurlin commented 6 years ago

Driver of WRT32x is not mwlwifi. It takes time to port MU-MIMO to mwlwifi.

BrainSlayer commented 6 years ago

the wrt32x and the wrt3200acm are identical devices. just firmware and price is different. mu-mimo is working for the factory firmwares for wrt3200acm and wrt32x. no difference here. but the driver used in these factory firmwares is not open source and propertiery. you cannot copy just the code to the opensource mwlwifi driver. first it would be a license problem, second the driver is totally different and does not make use of mac80211 etc. so even the code for mu-mimo would be totally different in mwlwifi once its done. the information exist, yes and marvell makes use of it to implement the same feature into mwlwifi. but its a work from scratch

yuhhaurlin commented 6 years ago

@BrainSlayer Thanks.

ad019 commented 6 years ago

@yuhhaurlin do you have scheduled time period in mind for MU-MIMO?

adamcarter1 commented 6 years ago

Wow, so in essence the 32x even though the firmware is quite unlike the 3200 firmware “a very resorceful person on the dd-wrt firmware who decoded it, said , looking at the files that it was loosely based on “open wrt” so even though it is loosly based on that... the driver they use is specifically designed to work only with the propriatary firmware.

Seems to me that it is very inefficient, way to do things.

As far as licensing issues. Isn’t marvell making the drivers for all firmwares? Who would they have to pay? themselves?

aaron1959 commented 6 years ago

The key word is loosely.

BrainSlayer commented 6 years ago

@adamcarter1 : first i was the one who decoded the firmware and analysed it too look for the so called gaming feature which was just a few lines of qos script. and no the propertiery marvell driver can work with any firmware. it doesnt matter if its openwrt or anything else. its just a driver and its not just loosely based on openwrt, the firmware is 100% openwrt. in fact a guy known to me from the old openwrt community wrote the firmware. or lets say i found indications that he wrote parts of it. fun fact, you can find his name here on this github url

adamcarter1 commented 6 years ago

@BrainSlayer Well april also looked at it too, she may have been the first after it was publically available. Forget her handle

Lol, what a close knit community we have...

Open wrt, lede, dd-wrt. From my extremely limited knowledge. 32x is as u say 100% open wrt, according to lede’s website lede is a Linux operating system based on OpenWrt.

Again i get it all this stuff is different.... for all intensive purposes.

But comparing just oem firmwares.... would i be correct in saying that when looking at the oem 3200 firmware vs oem 32x firmware and comparing them to lede and dd-wrt. that lede/dd-wrt have more in common with the oem 32x firmwarw than they do with the oem 3200acm firmware?

BrainSlayer commented 6 years ago

dont know her from the dd-wrt community. but good to know that there are girls around :-) lede is a fork of openwrt and openwrt is dead. right now they want to rename lede back to openwrt. just curious things are going on. i could tell you more about the background but this would turn your world upside down and some people would not like that i talk about some background secrets. but to your question. lede/openwrt has more in common with the wrt32x firmware and almost nothing in common with the wrt3200acm. dd-wrt has nothing in common with both of them since dd-wrt has a different architecture and is mainly based and written in C code instead of shell scripts and lua. but we use the same applications packages and share alot of kernel patches and enhancements. so dd-wrt and lede is also working together in background for making things better

yuhhaurlin commented 6 years ago

I commit updated firmware 9.3.2.1 and code for WDS client. WDS AP is still under development. If you want, you can test it. However, this is pre-release.

BrainSlayer commented 6 years ago

cool. let me prepare a testbuild

BrainSlayer commented 6 years ago

testimages for wds station support ftp://ftp.dd-wrt.com/others/test/linksys-wrt3200acm/

spamtree commented 6 years ago

@yuhhaurlin Thanks

That explains why attempt last week to setup WDS totally failed. Anyway got relayd working and that works fine for what I am doing.

However, will WDS be compatible with other routers using 4-address mode? Can I use another router like an atheros router? Got a little confused when reading about WDS. I thought it didn't work was because I was using an atheros router and wrt3200acm router that is why I used relayd.

BrainSlayer commented 6 years ago

@spamtree thats the plan. just test it. the current mwlwifi tree should be wds sta capable and i provided a dd-wrt testimage. for lede/openwrt you have to compile your own testimage

eduperez commented 6 years ago

@spamtree I am building updated packages of the mwlwifi driver, to be installed on top of stable LEDE versions, at https://github.com/eduperez/mwlwifi_LEDE/; you do not need to build them yourself.

(I just mentioned this in another thread, hope this does not annoy anyone, or is seen as spam)

aaron1959 commented 6 years ago

@eduperez I saw that other one. I thank you for keeping those folks updated.

yuhhaurlin commented 6 years ago

@spamtree

  1. For normal station mode, you need to use relayd.
  2. Yes. It can work with other device running as OpenWrt 4 address WDS. However only WDS client works for WRT3200ACM now.
yuhhaurlin commented 6 years ago

@eduperez Thanks for your help.

spamtree commented 6 years ago

@yuhhaurlin I understand now. Thanks for the explanation. @eduperez Will driver work with davidc502 builds? Thanks

eduperez commented 6 years ago

@spamtree No, LEDE / OpenWrt will only install kernel modules when they match the exact same kernel version and compilation parameters. However, @davidc502 has already updated his builds.

eduperez commented 6 years ago

@yuhhaurlin Shall we report bugs about WDS here, and help you? Or is it still too soon, and we will disturb your workflow?

yuhhaurlin commented 6 years ago

Yes. You can report problem here.

InkblotAdmirer commented 6 years ago

Thanks for working on the WDS implementation. I have a Rango configured for WDS STA mode on both 2.4G and 5G, it's been running almost a day now -- it wirelessly bridges a LAN and guest network.

Speed is great (5G link: [SUM] 0.00-20.03 sec 1.37 GBytes 588 Mbits/sec receiver

No issues to note on either band so far! I'm happy to run any tests, especially if any are necessary to get WDS AP mode enabled -- this will allow me to finalize my envisioned network. Thanks again!

wwtk commented 6 years ago

Hello and thanks for the efforts!

I tried WDS mode betwen R8000 AP and 3200ACM STA but it keeps dropping and reconnecting.

[ 69.256209] wlan0: authenticate with e8:fc:af [ 69.357326] ieee80211 phy0: change: 0x100 [ 69.370379] ieee80211 phy0: change: 0x100 [ 69.383425] ieee80211 phy0: change: 0x42 [ 69.485316] ieee80211 phy0: change: 0x2 [ 69.489218] wlan0: send auth to e8:fc:af: (try 1/3) [ 69.495574] wlan0: authenticated [ 69.501333] wlan0: associate with e8:fc:af: (try 1/3) [ 69.508260] wlan0: RX AssocResp from e8:fc:af: (capab=0x11 status=0 aid=2) [ 69.591302] ieee80211 phy0: change: 0x2 [ 69.595166] wlan0: associated [ 69.598181] wlan0: Limiting TX power to 30 (30 - 0) dBm as advertised by e8:fc:af: [ 72.645788] wlan0: deauthenticated from e8:fc:af:f7: (Reason: 2=PREV_AUTH_NOT_VALID) [ 72.721405] ieee80211 phy0: staid 1 deleted [ 72.730422] ieee80211 phy0: staid 2 deleted

I compiled this driver, is it correct one?

driver name: mwlwifi chip type: 88W8964 hw version: 7 driver version: 10.3.4.0-20171129 firmware version: 0x09030201 power table loaded from dts: no firmware region code: 0x0 mac address: 60:38:e0: 2g: disable 5g: enable antenna: 4 4 irq number: 45 ap macid support: 0000ffff sta macid support: 00010000 macid used: 00010000 radio: enable iobase0: e1000000 iobase1: e1280000 tx limit: 1024 rx limit: 16384

BrainSlayer commented 6 years ago

the netgear r8000 has a broadcom chipset and has no wds ap support

wwtk commented 6 years ago

crap, thanks :( I guess its time to shop for a new tri band router that does grrrr

BrainSlayer commented 6 years ago

you need to check for qca chipsets and whats more important. it must be capable of running openwrt/lede or dd-wrt

since the vendor firmwares normally do not support wds ap / wds sta features

wwtk commented 6 years ago

yes, thanks for those tips I appreciate them. It appears to be a tall order though as most bleeding edge hardware has limited support open firmware wise until they mature which is understandable.

tew828dru does have vendor wds support and it appears some dd-wrt support though I personally prefer lede only because I like the more linuxish approach to storing of the config files. In other words vi and I are long time friends.

I will try searching for qca chipsets and see what turns up, thanks again!

BrainSlayer commented 6 years ago

that itsnt true. even bleeding hardware hardware is well supported by opensource firmwares. the tew828 may run with lede. lede has support for the chipset, just dont know if there is direct support for it. the tew828 has also the worst chinese build quality i have ever seen.

spamtree commented 6 years ago

Finally tested wds mode. Much easier to setup than relayd.

wrt3200acm Worked perfect in "station" mode with atheros ar7161 as "ap" mode using 2.4 and 5 bands. Speed was excellent but the routers where only about 14cm apart.

Looks like a minor bug in the atheros wds implementation because the wds station does not showup in ifconfig but still works fine. I have seen this reported elsewhere. On the wrt3200acm ifconfig reports wds station as 'wlan1.sta1'.

Thanks!

yuhhaurlin commented 6 years ago

@spamtree Yes. The setting for OpenWrt 4 address WDS is pretty simple via WEB GUI. For AP, you only need to choose "Access Point (WDS)" instead of "Access Point". For Client, you only need to create an interface "Client (WDS)" and set SSID and open/security mode just like the setting of AP (WDS). You also need to let this interface join bridge. After WDS connection is established, AP (WDS) will create a virtual interface to work with Client (WDS). All devices hooked to LAN of these two devices can communicate with each other due to this WDS link. Another good thing is that AP (WDS) can still allow normal client to connect to it.

BrainSlayer commented 6 years ago

@spamtree : your description doesnt sound true. on station side the interface has the wlan1 name and on wds ap side it should be named wlan1.staX for each connected wds station. so there is no bug in the atheros wds implementation. ath9k and ath10k behaves exact like this.

spamtree commented 6 years ago

@yuhhaurlin and @BrainSlayer

Thanks for the information. That was correct information and the artheros does not have luci installed. WDS works perfectly but the WDS interface does not show up when listing the interfaces on the artheros based router there is no wlan1.staX. Anyway I got that information about setting up 4 address wds from https://wiki.openwrt.org/doc/recipes/atheroswds It states in the howto that " (Note: when tested on Barrier Breaker, there was no new interface created, neither on the AP nor on the STA, despite WDS working properly)."

My artheros router is pretty old, so it is not a problem that it does not have wlan1.staX in the output for "ip" or "ifconfig", it still works perfectly. My artheros router was made in 2012 so it is pretty old and that could be the problem why all the interfaces don't show but it works perfectly with WDS "station" or "ap". It uses the ath9k modules.

I guess I should not have mentioned the artheros at all (sorry about that). Only use it for testing or as a relayd when I am in the back yard.

Lets stick to the wrt3200acm and so far everything works as expect with station mode WDS and output from "ip" and "ifconfig" both show the wlan1.staX interface.

Now correct me if I am wrong but I thought the wrt3200acm only supports wds "station" mode now and that wds "ap" is coming later.

Thanks this is working great!

yuhhaurlin commented 6 years ago

Yes. I work on WDS AP now.

BrainSlayer commented 6 years ago

@yuhhaurlin can you explain why the mwlwifi driver creates a wlan1.sta0 interface in wds station mode? this isnt neccessary. this is only required in wds ap mode and was introduced in mac80211 as solution for inter station communication for broadcast packets.

spamtree commented 6 years ago

@BrainSlayer Do you think this could have something to do with LEDE?

BrainSlayer commented 6 years ago

@spamtree no, the sub interfaces .staX are created by mac80211 and lede as well as dd-wrt are almost in sync. we use the same driver base.

yuhhaurlin commented 6 years ago

@BrainSlayer Only WDS AP will create this kind of virtual interface. If you add wds_sta to configuration file of hostapd, hostapd will create this kind of interface if WDS client is connected. For WDS client, it uses the original interface.

BrainSlayer commented 6 years ago

@yuhhaurlin: i know. i just took the comment from "spamtree" since he said it creates a .staX interface in station side which is unusual for me and not correct. this is why i'm asking

yuhhaurlin commented 6 years ago

@BrainSlayer I think he means WDS AP. WDS client will use the original interface created for it.

BrainSlayer commented 6 years ago

i thought that, thats why i reasked him about the behaviour. but he wrote again that its on station side

spamtree commented 6 years ago

I understand completely now. I will test again and report back with more output. Thanks.

spamtree commented 6 years ago

I was completely wrong. @BrainSlayer you were correct.

This is from the netgear in wds ap mode.

root@netgear:~# ifconfig wlan0.sta1 wlan0.sta1 Link encap:Ethernet HWaddr 04:A1:51:9E:36:6E
inet6 addr: fe80::6a1:51ff:fe9e:366e/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:5587 errors:0 dropped:0 overruns:0 frame:0 TX packets:177 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:623142 (608.5 KiB) TX bytes:31337 (30.6 KiB)

This is the output from the wrt3200acm in wds station mode. wlan1 Link encap:Ethernet HWaddr 60:38:E0:BA:DC:21
inet6 addr: fe80::6238:e0ff:feba:dc21/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:346 errors:0 dropped:0 overruns:0 frame:0 TX packets:5687 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:44190 (43.1 KiB) TX bytes:783720 (765.3 KiB)


There is no "wlan1.staX" on the wrt3200acm in wds station mode. To put it bluntly my previous posting was incorrect.

I will be more careful in the future when reviewing and posting information and I apologize for posting inaccurate information.

yuhhaurlin commented 6 years ago

F.Y.I. You can use iw.

<<OpenWrt 4 address WDS mode>>

  1. Device 1:

If there is any WDS client connected to WDS AP, WDS AP will create a virtual interface (AP/VLAN: wlan0.staX) to establish WDS link with WDS client.

root@LEDE:/# iw dev phy#0 Interface wlan0.sta2 ifindex 18 wdev 0xa addr 00:50:43:22:15:b8 type AP/VLAN channel 149 (5745 MHz), width: 80 MHz, center1: 5775 MHz txpower 30.00 dBm Interface wlan0 ifindex 17 wdev 0x9 addr 00:50:43:22:15:b8 ssid LEDE-8964-5g-wds-ap type AP channel 149 (5745 MHz), width: 80 MHz, center1: 5775 MHz txpower 30.00 dBm root@LEDE:/# brctl show bridge name bridge id STP enabled interfaces br-lan 7fff.005043253133 no eth0 eth1 wlan0 wlan0.sta2

  1. Device 2:

root@LEDE:/# iw dev phy#0 Interface wlan0 ifindex 36 wdev 0x1c addr 00:50:43:22:2c:c4 type managed channel 149 (5745 MHz), width: 80 MHz, center1: 5775 MHz txpower 30.00 dBm root@LEDE:/# brctl show bridge name bridge id STP enabled interfaces br-lan 7fff.005043000202 no eth0 eth1 wlan0

yuhhaurlin commented 6 years ago

BTW, you can reference following links: https://wireless.wiki.kernel.org/en/users/documentation/iw (Using 4-address for AP and client mode) https://wiki.openwrt.org/doc/howto/clientmode

spamtree commented 6 years ago

@yuhhaurlin Thanks learning all the time.

yuhhaurlin commented 6 years ago

I commit code related to WDS AP. In order to support it, firmware should be updated to 9.3.2.2. This is pre-release. I will still do more tests. If you like, you can help to test it. I plan to release code to QA for test late this week or early next week. If you find any problems, please let me know.