Date: Mon, 14 Apr 2008 21:28:06 +0400 From: Alex Keda <admin@lissyara.su> To: Sam Leffler <sam@errno.com> Cc: FreeBSD Current <freebsd-current@freebsd.org> Subject: Re: CFT: 802.11 vap code Message-ID: <48039426.4010801@lissyara.su> In-Reply-To: <480294E2.1000907@errno.com> References: <480294E2.1000907@errno.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Sam Leffler пишет: > A patch to integrate my multi-bss (aka vap) support for wireless can be > found here: > > http://www.freebsd.org/~sam/vap-2008051300.sh.gz > > Note this is a shell script that overlays the CVS contents for HEAD. > To apply it you do something like: > > cvs -d /usr/ncvs co src > cd src > gzcat ../vap-2008051300.sh.gz | sh > > The changes are extensive and require a full buildworld and kernel > rebuild. Committers with perforce access can find this code in the > sam_vap branch. > > So what is this stuff? This is work I started many years ago to > virtualize 802.11 wireless devices. The intent was (mostly) to > support multiple access points operating on top of a single radio. > The classic example is you want to run a Hotspot and offer quality > service to paying customers but still provide some level of service > to freeloaders. You can define two Virtual AP's (VAP's) and make > one open with the second require authorization. This is done by > cloning virtual ifnet's from the parent device using ifconfig; e.g. > > ifconfig wlan create wlandev ral0 wlanmode hostap > > will generate a wlanX ifnet that supports ap operation. Different > devices are capable of supporting different services; some > drivers/devices only support one vap at a time which is equivalent > to what is currently in CVS but without using the mediaopt mechanism > to switch "operating modes" (with vaps an interface never changes > it's operating mode; when you no longer want to use one you just > destroy it and create something else). > > In practice most casual users will not encounter vaps except when > they run ifconfig and see wlanX interfaces. rc support is present > to automatically create vaps' for station mode operation. If you > have an ath0 device you add this to your rc.conf: > > vaps_ath0="wlan0" > ifconfig_wlan0="DHCP WPA" > > and you'll get a wlan0 ifnet created and wpa_supplicant will be > brought up as usual (thanks to Brooks Davis for this work). > > Vaps were motivated by doing multi-bss ap services but evolved to > support many other features. In particular WDS support falls out > and later grew to support Dynamic WDS (DWDS) which is a follow-on > design that combines WDS operation (i.e. 4-address frame encapsulation > of wireless traffic) with normal station and access point operation > to build more powerful and useful applications. Sample scripts to > setup DWDS relay and master nodes can be found in the directory: > > tools/tools/net80211/scripts > > along with many other scripts used in testing. > > This code includes a major rewrite of the net80211 layer and > significant changes to all wireless drivers. Two drivers are still > not converted: ipw and ndis. Station and access point operation > are well tested but adhoc mode is untested and likely broken. > Monitor mode works but has one design/usage issue that may require > changes. The documentation is alpha-quality and needs work. > > This work has been used in several products and been heavily tested > in various forms but on non-FreeBSD platforms. Work on the current > version has been supported by Hobnob. The most recent previous > work was supported by Marvell (who also supported development of > the mwl driver). Atheros contributed code that was used to kickstart > the vap + 802.11n functionality. Any issues you hit are likely to be in > drivers and not net80211--particularlly drivers that are less frequently > used. > > My goal is to get this work into CVS asap. There is one outstanding > locking issue that people may encounter: the net80211 layer holds a > lock over calls to the driver's init method which can cause WITNESS > complaints if the driver sleeps. This is most noticeable on drivers > that load firmware or otherwise sleep (e.g. usb drivers). Some drivers > can avoid this by loading firmware in the vap create method but the > usb drivers may have to drop the lock and open a race. Folks are > encouraged to pitch in to help with these and any other issues they > encounter. > > Note there are a few new drivers included: iwn (Intel 4965), bwi > (Broadcom 43xx), and mwl (Marvell 88W8363). The iwn driver is > unfinished; it should support 802.11n but progress has been slow > due to poor vendor involvement. The bwi driver is experimental and > folks are encouraged to help sephe get it into shape for commit (it > currently is not ready CVS). mwl is provided as an example of a > working 11n driver; I'm not aware of any cardbus/pci retail products > that use this part and firmware is presently unavailable (we could > get firmware but since all applications are presently embedded > anyone that would want firmware already has it). Finally, wi users > should note there is a rewrite of the driver that now works properly > with wpa_supplicant and supports WPA (both in station and ap modes) > with Intersil Prism cards and rev 1.7.0 and later firmware. (But > the flip side is that Symbol card support was dropped and some older > cards may not work well w/o fixups.) > > Please report problems to the public mailing lists. My time is scarce > so please investigate fixes and not just report problems. > > BSDCan plug: I'll be giving a tutorial in Ottawa that uses this work > so folks looking to attend can get a headstart. > > Sam buildworld: (cd /usr/src/rescue/rescue/../../sbin/ifconfig && make -DRESCUE CRUNCH_CFLAGS=-DRESCUE DIRPRFX=rescue/rescue/ifconfig/ depend && make -DRESCUE CRUNCH_CFLAGS=-DRESCUE DIRPRFX=rescue/rescue/ifconfig/ ifconfig.o af_link.o af_inet.o af_inet6.o af_atalk.o ifclone.o ifmac.o ifmedia.o ifvlan.o ifieee80211.o regdomain.o ifcarp.o ifgroup.o ifpfsync.o ifbridge.o iflagg.o af_ipx.o) rm -f .depend mkdep -f .depend -a -DRESCUE /usr/src/sbin/ifconfig/ifconfig.c /usr/src/sbin/ifconfig/af_link.c /usr/src/sbin/ifconfig/af_inet.c /usr/src/sbin/ifconfig/af_inet6.c /usr/src/sbin/ifconfig/af_atalk.c /usr/src/sbin/ifconfig/ifclone.c /usr/src/sbin/ifconfig/ifmac.c /usr/src/sbin/ifconfig/ifmedia.c /usr/src/sbin/ifconfig/ifvlan.c /usr/src/sbin/ifconfig/ifieee80211.c /usr/src/sbin/ifconfig/regdomain.c /usr/src/sbin/ifconfig/ifcarp.c /usr/src/sbin/ifconfig/ifgroup.c /usr/src/sbin/ifconfig/ifpfsync.c /usr/src/sbin/ifconfig/ifbridge.c /usr/src/sbin/ifconfig/iflagg.c /usr/src/sbin/ifconfig/af_ipx.c echo ifconfig: /usr/obj/usr/src/tmp/usr/lib/libc.a /usr/obj/usr/src/tmp/usr/lib/libbsdxml.a /usr/obj/usr/src/tmp/usr/lib/libsbuf.a /usr/obj/usr/src/tmp/usr/lib/libipx.a >> .depend cc -O2 -pipe -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wnested-externs -DRESCUE -Wno-pointer-sign -c /usr/src/sbin/ifconfig/ifconfig.c cc -O2 -pipe -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wnested-externs -DRESCUE -Wno-pointer-sign -c /usr/src/sbin/ifconfig/af_link.c cc -O2 -pipe -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wnested-externs -DRESCUE -Wno-pointer-sign -c /usr/src/sbin/ifconfig/af_inet.c cc -O2 -pipe -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wnested-externs -DRESCUE -Wno-pointer-sign -c /usr/src/sbin/ifconfig/af_inet6.c cc -O2 -pipe -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wnested-externs -DRESCUE -Wno-pointer-sign -c /usr/src/sbin/ifconfig/af_atalk.c cc -O2 -pipe -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wnested-externs -DRESCUE -Wno-pointer-sign -c /usr/src/sbin/ifconfig/ifclone.c cc -O2 -pipe -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wnested-externs -DRESCUE -Wno-pointer-sign -c /usr/src/sbin/ifconfig/ifmac.c cc -O2 -pipe -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wnested-externs -DRESCUE -Wno-pointer-sign -c /usr/src/sbin/ifconfig/ifmedia.c cc -O2 -pipe -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wnested-externs -DRESCUE -Wno-pointer-sign -c /usr/src/sbin/ifconfig/ifvlan.c cc -O2 -pipe -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wnested-externs -DRESCUE -Wno-pointer-sign -c /usr/src/sbin/ifconfig/ifieee80211.c cc -O2 -pipe -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wnested-externs -DRESCUE -Wno-pointer-sign -c /usr/src/sbin/ifconfig/regdomain.c /usr/src/sbin/ifconfig/regdomain.c:662: error: redefinition of 'rcsid' /usr/src/sbin/ifconfig/regdomain.c:26: error: previous definition of 'rcsid' was here /usr/src/sbin/ifconfig/regdomain.c:686: error: redefinition of 'struct mystate' /usr/src/sbin/ifconfig/regdomain.c:698: error: redefinition of 'struct ident' /usr/src/sbin/ifconfig/regdomain.c:701: error: redeclaration of enumerator 'DOMAIN' /usr/src/sbin/ifconfig/regdomain.c:65: error: previous definition of 'DOMAIN' was here /usr/src/sbin/ifconfig/regdomain.c:701: error: redeclaration of enumerator 'COUNTRY' /usr/src/sbin/ifconfig/regdomain.c:65: error: previous definition of 'COUNTRY' was here /usr/src/sbin/ifconfig/regdomain.c:701: error: redeclaration of enumerator 'FREQBAND' /usr/src/sbin/ifconfig/regdomain.c:65: error: previous definition of 'FREQBAND' was here /usr/src/sbin/ifconfig/regdomain.c:706: error: redefinition of 'start_element' /usr/src/sbin/ifconfig/regdomain.c:70: error: previous definition of 'start_element' was here /usr/src/sbin/ifconfig/regdomain.c:800: error: redefinition of 'decode_flag' /usr/src/sbin/ifconfig/regdomain.c:164: error: previous definition of 'decode_flag' was here /usr/src/sbin/ifconfig/regdomain.c:850: error: redefinition of 'end_element' /usr/src/sbin/ifconfig/regdomain.c:214: error: previous definition of 'end_element' was here /usr/src/sbin/ifconfig/regdomain.c:989: error: redefinition of 'char_data' /usr/src/sbin/ifconfig/regdomain.c:353: error: previous definition of 'char_data' was here /usr/src/sbin/ifconfig/regdomain.c:1007: error: redefinition of 'findid' /usr/src/sbin/ifconfig/regdomain.c:371: error: previous definition of 'findid' was here /usr/src/sbin/ifconfig/regdomain.c:1021: error: redefinition of 'lib80211_regdomain_readconfig' /usr/src/sbin/ifconfig/regdomain.c:385: error: previous definition of 'lib80211_regdomain_readconfig' was here /usr/src/sbin/ifconfig/regdomain.c:1103: error: redefinition of 'cleanup_bands' /usr/src/sbin/ifconfig/regdomain.c:467: error: previous definition of 'cleanup_bands' was here /usr/src/sbin/ifconfig/regdomain.c:1119: error: redefinition of 'lib80211_regdomain_cleanup' /usr/src/sbin/ifconfig/regdomain.c:483: error: previous definition of 'lib80211_regdomain_cleanup' was here /usr/src/sbin/ifconfig/regdomain.c:1156: error: redefinition of 'lib80211_alloc_regdata' /usr/src/sbin/ifconfig/regdomain.c:520: error: previous definition of 'lib80211_alloc_regdata' was here /usr/src/sbin/ifconfig/regdomain.c:1206: error: redefinition of 'lib80211_free_regdata' /usr/src/sbin/ifconfig/regdomain.c:570: error: previous definition of 'lib80211_free_regdata' was here /usr/src/sbin/ifconfig/regdomain.c:1216: error: redefinition of 'lib80211_regdomain_findbysku' /usr/src/sbin/ifconfig/regdomain.c:580: error: previous definition of 'lib80211_regdomain_findbysku' was here /usr/src/sbin/ifconfig/regdomain.c:1231: error: redefinition of 'lib80211_regdomain_findbyname' /usr/src/sbin/ifconfig/regdomain.c:595: error: previous definition of 'lib80211_regdomain_findbyname' was here /usr/src/sbin/ifconfig/regdomain.c:1246: error: redefinition of 'lib80211_country_findbycc' /usr/src/sbin/ifconfig/regdomain.c:610: error: previous definition of 'lib80211_country_findbycc' was here /usr/src/sbin/ifconfig/regdomain.c:1261: error: redefinition of 'lib80211_country_findbyname' /usr/src/sbin/ifconfig/regdomain.c:625: error: previous definition of 'lib80211_country_findbyname' was here *** Error code 1 Stop in /usr/src/sbin/ifconfig. *** Error code 1 Stop in /tmp/obj/usr/src/rescue/rescue. *** Error code 1 Stop in /usr/src/rescue/rescue. *** Error code 1 Stop in /usr/src/rescue. *** Error code 1 Stop in /usr/src. *** Error code 1 Stop in /usr/src. *** Error code 1 Stop in /usr/src. # # uname -a FreeBSD acer.lissyara.int.otradno.ru 8.0-CURRENT FreeBSD 8.0-CURRENT #0: Mon Apr 7 23:36:27 MSD 2008 lissyara@acer.lissyara.int.otradno.ru:/tmp/obj/usr/src/sys/main-color-console amd64 # source updated 2 hour ago
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48039426.4010801>