The __UNCONST macro is now used only where necessary and the RW macros
are gone. Most of the changes here are consumers of the
sysctl_createv(9) interface that now takes a pair of const pointers
which used not to be.
(mail@janderson.ca): remove ieee80211_ibss_merge's TSFT argument.
Do the TSFT comparison in the drivers (ath, atw). Remove a lot of
extraneous debug statements from ieee80211_ibss_merge.
Set the ieee80211_node's state to IEEE80211_STA_BSS after it's been
copied to the ic_bss, not before.
In struct ieee80211_node, make the ni_tstamp field a union of a
uint64_t and the 8 TSF octets so that it's easier to compare a
neighbor's TSF with the local TSF.
Log IBSS merges (Greg Troxel's suggestion). Also log IBSS creation.
These are rare and important events that deserve to be logged.
Set a shorter 802.11 Duration field, accordingly.
XXX We expect CTS/ACK at 1 Mb/s for 1 & 2 Mb/s stations; and CTS/ACK
at 2 Mb/s for 5.5 & 11 Mb/s stations. We need to check with the
802.11 standard. Rate negotiation may need to be overhauld for
standards compliance, too.
* Add an intermediate variable, ctsrate, which is currently derived directly
from rate, but may be handled differently later (especially for 11g).
* Assume ACKs are sent at the same rate as the original data packet, as ath
does, shortening the ACK reservation time substantially.
* Add a note that we need to deal with not adding the ACK time for some
packets, though this is not implemented yet.
Questions:
* How do we affect the control rate used to send RTS/CTS packets?
* Is the PLCP header length actually controlled by the preamble length
selection, or should this be based on the transmit rate?
Of course short preamble is not actually implemented/working yet.
empty/unused octets to fill out the data time slot. The value is constrained
by math to 0 for <= 5.5Mb, 0-1 for 11Mb, and 0-2 for 22Mb. It is used to
signal to the MAC that there is residue.
in an 802.11 unicast data packet is equal to the duration of the
SIFS and Acknowledgement. That is, the amount of time reserved
*after* the packet has finished transmitting.
Change the arguments to ieee80211_compute_duration: pass the entire
packet length, not just the payload length. Add a 'debug' argument
to ieee80211_compute_duration and its helper subroutine,
ieee80211_compute_duration1.
If debug != 0, ieee80211_compute_duration printfs its arguments
and several local variables.
In rtw(4), load the 802.11 Duration field with the result from
ieee80211_compute_duration.
Protect SIOCG80211STATS with splnet()/splx() so that it takes a
"snapshot" of the 802.11 statistics, which is superfluous if
ieee80211_ioctl is always called at splnet()....
For use by the subroutine ieee80211_compute_duration, add struct
ieee80211_duration, and #define a number of microsecond constants
used for the transmit timing of 802.11 packets.
Add the subroutine ieee80211_compute_duration, which computes for
any packet the appropriate 802.11 Duration field, the PLCP Length
field, as well as the Duration and Length fields for an RTS frame.
atw(4), rtw(4), future drivers, and possibly ath(4) will share
ieee80211_compute_duration.
if ni == NULL and the operating mode was not "ad hoc" or "ad hoc
demo." That crashed the kernel. Now, if the operating mode is
not "ad hoc (demo)," and ni == NULL, return NULL right away.
Also, if ieee80211_dup_bss returns NULL, return NULL right away.
This doesn't fix a bug, but it makes clear how this works.
are at the end of the node queue. Change the reference-counting
discipline: ni->ni_refcnt indicates how many times net80211 has
granted ni to the driver. Every node in the table with ni_refcnt=0
is eligible to be garbage-collected. The mere presence of a node
in the table does not any longer indicate its auth/assoc state;
nodes have a ni_state variable, now. A sysctl,
net.link.ieee80211.maxnodecache, controls the maximum LRU cache
size.
While I am here, patch ieee80211_find_node_for_beacon to do a "best
match" by bssid/ssid/channel, not a "perfect match." This keeps
net80211 from caching duplicate nodes in the table.
ieee80211_input():
* Do not discard management frames in station mode just because they have
the wrong BSSID.
* Do not discard beacons in station and host-AP mode when not scanning.
* Some minor rearrangement. Update node statistics even if the packet is
rejected.
ieee80211_recv_mgmt():
* Accept probe responses and beacons in station and host-AP even when not
scanning.
* Do not immediately free the node created by a beacon or probe response.
XXX Should I check BSSIDs more carefully in ieee80211_recv_mgmt() --
specifically for ASSOC_RESP, REASSOC_RESP, AUTH, DEAUTH and DISASSOC?
Fix a problem with APs that advertise multiple SSIDs:
Change the footprint of ieee80211_find_node_with_channel() to take a SSID as
well, and, if not empty, compared it with the existing nodes. This causes
us to allocate multiple nodes for the same AP. Without this we were only
leaving one SSID in the node table, which might not be the desired one, and
so the interface would fail to fully initialize. (Reported by he@ with a
Cisco 350 AP.)
Responses. Ad hoc mode uses these entries to track network peers.
This provides passive-scan information for the current channel in
infrastructure mode (XXX really should keep it in a different
table). Host APs will someday use these entries to track APs in
the same ESS for AP-to-AP bridging.
must use a full node for received management frames, or we are unable to
complete association and talk to the client. I could add an
"if mode == HOSTAP" to fix this, but instead I am reverting the change and
remanding it to the person who broke it.
IBSS nodes. Do not send an EXPIRE-type DEAUTH message when IBSS
nodes time-out. This ends the panic that rev 1.25 fixed, but
without a dual-use ieee80211_node_leave.
will eventually share it.
In the IBSS merge logic, check conditions in a different order so
that they run faster in the common case---no merge. Fix the
rate-limiting on the debug outputs (enabled by IFF_LINK0).
Abstract some of the node management code into separate functions, and use them
throughout, plugging memory leaks.
Allocate the AID allocation map dynamically.
Change the signature of IEEE80211_DPRINTF() so that it uses a bitmask, and
convert some of the if_printf()s to IEEE80211_DPRINTF()s. XXX I'm using a
global variable at the moment rather than per-interface.
that we create the network with the BSSID preferred by the operator.
[Say the operator set the desired BSSID with 'ifconfig atw0 bssid
02:25:25:75:75:75'. If no such network is found during scanning,
then create the network with that BSSID.]
Instead, change *_set11gbasicrate() to *_setbasicrates(), have it operate on
all modes, and call it from *_ifattach(). Also, fix obvious bugs in it (it
had an off-by-one error, at least).
beacon-sender's ieee80211_node, if ni->ni_esslen == 0. This fixes
WEP for Matthew. I think that it also will save us from IBSS
splits.
Thanks again, Matthew Gream.
peer, we have to copy the "master" rate table to the faked-up node's
rate table, or else ath0 will complain, "ath0: bogus xmit rate
0x0". Thank you Konstantin KABASSANOV for reporting this problem.
peer, we have to copy the "master" rate table to the faked-up node's
rate table, or else ath0 will complain, "ath0: bogus xmit rate
0x0". Thank you Konstantin KABASSANOV for reporting this problem.
net.link.ieee80211. The convention is that nodes directly under
net are protocol families (PF_*).
Also, simplify the sysctl setup for net80211 and rssadapt, following
another suggestion by Andrew.
and off.
Add a sysctl, net.ieee80211.maxinact, for adjusting the node time-out
interval. After net.ieee80211.maxinact seconds of inactivity, an
AP will purge a peer/client-record. Now the client has to reassociate.
independently from net80211 debug messages. Create a new sysctl,
net.ieee80211.rssadapt.debug, for turning the debug messages on
and off.
Create a new sysctl, net.ieee80211.rssadapt.expavgctl, to control
the rate of decay for the exponential averages used by rssadapt(9).
Fix authentication where I had botched it with the FreeBSD import.
(In FreeBSD, net80211 is strangely subroutine-averse, so where we
have ieee80211_auth_open and ieee80211_auth_shared, they incorporate
all of ieee80211_auth_open into ieee80211_recv_mgmt. I had not
realized that was why the 20 lines of new code.)