Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Oct 2019 16:05:33 -0400
From:      Austin Shafer <ashafer@badland.io>
To:        Farhan Khan <farhan@farhan.codes>
Cc:        freebsd-wireless@freebsd.org
Subject:   Re: Best way to explore the 802.11 rtwn source code?
Message-ID:  <512B62A4-CCB7-4C05-A988-0E19443A2DD0@badland.io>
In-Reply-To: <d3705517-ae52-4644-883d-6e65d327e93d@www.fastmail.com>
References:  <1F9F7008-59C4-42DF-AF1E-0028BD9576F5@badland.io> <d3705517-ae52-4644-883d-6e65d327e93d@www.fastmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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=E2=80=99ve 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. =46rom 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?512B62A4-CCB7-4C05-A988-0E19443A2DD0>