Subject: CVS commit: src/sys/dev/ic
To: None <source-changes@NetBSD.org>
From: David Young <dyoung@netbsd.org>
List: source-changes
Date: 01/19/2005 04:56:42
Module Name:	src
Committed By:	dyoung
Date:		Wed Jan 19 04:56:42 UTC 2005

Modified Files:
	src/sys/dev/ic: ath.c

Log Message:
For a proper IBSS merge, we have to discard the old beacon packet,
create and queue a new one that carries the new BSSID.  I mined
net80211 in FreeBSD for the solution, which is to make an
IEEE80211_S_RUN->IEEE80211_S_RUN state transition---ath_newstate
discards the old beacon packet creates a new one by calling
ath_beacon_alloc.

I tested the merge as follows.  Starting at my desk on the second
floor of the building where I work:

soekris% ifconfig ath0 mediaopt adhoc ssid zzz chan 11 down

powerbook% ifconfig rtw0 mediaopt adhoc ssid zzz chan 11 up

soekris% sleep 25; ifconfig ath0 up

I raced to the elevator with my Powerbook, pressed the "Down"
button, got in, and pressed "Floor 1."  At the first floor:

powerbook% ifconfig rtw0 | grep bssid
        bssid 02:p:p:p:p:p chan 11

I waited 25 seconds.  I pressed "Floor 2."  At Floor 2, I returned to my desk.
I checked to make sure that the Soekris console read:

soekris% ath0: creating bss 02:s:s:s:s:s
ath0: bss merge 02:s:s:s:s:s -> 02:p:p:p:p:p

0:s:s:s:s:s is the Soekris' WLAN MAC.  0:p:p:p:p:p is the Powerbook's
WLAN MAC.  Each created an ad hoc-mode BSSID from its WLAN MAC by
OR'ing 0x2 with the first octet.

My Powerbook created a network while the Soekris radio was off.
The Soekris radio turned on while I was in the 802.11-impervious
elevator with my Powerbook.  When I returned to the second floor,
the Soekris "heard" beacons from my Powerbook as the elevator door
opened.  Since the Powerbook's network was approximately 25 seconds
older than the Soekris', and since it had the same SSID (zzz) as
the Soekris', the Soekris merged with the Powerbook's network (by
setting its BSSID) as it should.


To generate a diff of this commit:
cvs rdiff -r1.43 -r1.44 src/sys/dev/ic/ath.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.