File:  [NetBSD Developer Wiki] / wikisrc / Testing_new_wifi.mdwn
Revision 1.2: download - view: text, annotated - select for diffs
Mon Sep 20 16:17:11 2021 UTC (4 weeks, 3 days ago) by wiki
Branches: MAIN
CVS tags: HEAD
web commit by martin: Improve build instructions

There is a project in progress to adapt the latest FreeBSD wifi stack for NetBSD.

This stack introduces the concept of a virtual access point (VAP) and requires changes to the way wifi networks are configured.

Currently there are no pre-build binary sets, so first task is to check out the wifi topic from hg and build it.

At this point a full build will not work (due to unconverted drivers), but you can do something along the lines of:

    build.sh -m ${arch} -V MKRUMP=no -V MKKMOD=no sets

to build the sets, and then create you own kernel configuration or add a GENERIC.local file and exclude the non buildable drivers.

There is a custom kernel sys/arch/amd64/conf/SEVEN_WIFI but you can also use
GENERIC and copy the "no ..." lines from SEVEN_WIFI to GENERIC.local. The
evbarm GENERIC kernel will work if you create GENERIC.local files like the following:

For evbarm:

    no athn*
    no bwfm*
    no atu*
    no otus*
    no rum*
    no run*
    no upgt*
    no ural*
    no urtw*
    no zyd*

and optionally:

    options	DEBUG		# expensive debugging checks/support
    options	LOCKDEBUG	# expensive locking checks/support
    options	IEEE80211_DEBUG # debug 802.11 code


After building userland sets and kernel install both! Important tools like 
ifconfig(8) and wpa_supplicant(8) have changed and the old binaries will not
work with the new kernel.

After booting into the new system you will notice that no wlan devices show up in ifconfig -a output. Instead you can see the wlan devices in sysctl output:

    # sysctl net.wlan
    net.wlan.debug = 0
    net.wlan.devices = urtwn0

Now you can create a VAP (called wlan0) by doing:

    # ifconfig wlan0 create wlandev urtwn0

This VAP shows up in sysctl output:

    # sysctl net.wlan
    net.wlan.debug = 0
    net.wlan.devices = urtwn0
    net.wlan.wlan0.parent = urtwn0
    net.wlan.wlan0.driver_caps = 629194753
    net.wlan.wlan0.debug = 0
    net.wlan.wlan0.bmiss_max = 2
    net.wlan.wlan0.inact_run = 300
    net.wlan.wlan0.inact_probe = 30
    net.wlan.wlan0.inact_auth = 180
    net.wlan.wlan0.inact_init = 30
    net.wlan.wlan0.ampdu_mintraffic_bk = 128
    net.wlan.wlan0.ampdu_mintraffic_be = 64
    net.wlan.wlan0.ampdu_mintraffic_vo = 32
    net.wlan.wlan0.ampdu_mintraffic_vi = 32
    net.wlan.wlan0.force_restart = 0

and you can further configure it with ifconfig

    # ifconfig wlan0 up
    # ifconfig wlan0 list scan
    SSID                  BSSID              CHAN RATE  S:N     INT CAPS
    aprisoft              e0:28:6d:59:cb:90    1   54M  94:0    100 EPS  WME WPA RSN


This sounds a bit strange at first sight, but multiple networks (one per VAP) for a single radio do make sense. Here is the original paper describing the design: [FreeBSD wireless BSDCan 2005](https://www.bsdcan.org/2005/papers/FreeBSDWirelessNetwokringSupport.pdf)

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb