Re: Best way to explore the 802.11 rtwn source code?

2019-10-31 Thread Austin Shafer via freebsd-wireless
Hi Farhan,

Thanks for the reply!

> rtwn is a bit more complicated than other drivers. Any rtwn device will
> require at least three drivers: The PCI or USB driver, the general rtwn
> driver which contains shared code, and the device-specific driver. While
> I'm sure you can follow the code, I would suggest starting with something
> a bit simpler. I learned the hard way :)

Yep I’ve noticed that pattern in other drivers, particularly the i2c
hid driver I messed around with. What's a good example of a "simple"
driver?

> One good approach would be to take a simple driver, look at its ieee802com
> object, and see what avenues the ieee80211 stack has to interact with the 
> driver.
> I would learn about the powering on process, setting up DMA, initializing the 
> interrupt
> code, and seeing how interrupts are handled. From there I would look into Rx, 
> Tx
> and then the rest of it.

Following through the rtwn_attach function I agree that following the
ieee80211com object is a good idea. If anyone else finds this useful
the r21au_attach function is also informative as it adds the interface
methods to the softc. The man pages are great as usual.

Is ieee80211_ifattach a good point to start reading? It seems to kick
off a cascade of *_attach methods which is a little tricky to keep
track of.

Reading all this does make me realize there are many 802.11 features I
don't know about, so if you have a good 802.11 reference I'd love to
hear it.

> Please let me know if this helps. Also, if you have any more specific
> questions, please let us know. What are your objectives?

My adapter has frequent times when it will have crippling packet loss
(40% to 100%) for 5 ish minutes until things all of a sudden return to
normal. I'd love to be able to figure out what's actually going wrong.

Also I'd enjoy some 802.11ac support, so if there is any grunt work
which a newbie can help with I am glad to chip in.

> I was writing an introduction on this very topic, but $LIFE and other
> projects got in the way. Maybe I should get back into it?

I'm not sure about others, but I would definitely read it.

Thanks!
Austin

___
freebsd-wireless@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-wireless
To unsubscribe, send any mail to "freebsd-wireless-unsubscr...@freebsd.org"


Best way to explore the 802.11 rtwn source code?

2019-10-30 Thread Austin Shafer via freebsd-wireless
Hi all,

I’m interested in hacking around with a netgear wifi adapter I have (rtwn). Are 
there any good resources for learning how to read and debug FreeBSD’s wireless 
network stack?

Robert Watson has a great overview of starting points for understanding the 
kernel as a whole, are there any similar "starting points" for network drivers?
http://www.watson.org/~robert/freebsd/reading/

The “Design and implementation ..” book covers networking and device driver 
creation which is helpful, but nothing about wireless. I did find a few like 
the following:
https://wiki.freebsd.org/MateuszPiotrowski/Drivers
https://wiki.freebsd.org/WiFi/BringUp

Any suggestions? I’d appreciate anything that helps me learn how all this stuff 
works.

Thanks in advance,
Austin
___
freebsd-wireless@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-wireless
To unsubscribe, send any mail to "freebsd-wireless-unsubscr...@freebsd.org"