the RX direction, but not in the TX direction. The
net80211 crypto framework doesn't seem to cope very well
with the assymetry (I'm probably missing something), so
I will use software WEP for now.
net80211: In ieee80211_compute_duration, figure out whether to add
the WEP header to the packet overhead by checking the
WEP bit in the Frame Control field of the 802.11 header,
instead of checking the IEEE80211_F_PRIVACY flag.
Also, if the WEP bit is present, assume that the frame
described by (wh, len) has already already been WEP
encapsulated, and adjust the payload length accordingly.
XXX that's a grotty hack that I will have to revisit,
later.
Change the way we walk 802.11 peers/clients: for each eligible
interface, walk the ic_sta (peers/clients) table, first; walk the
ic_scan (scan results) table, second; then visit the ic_bss (node
for the network joined/created by the interface).
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.)
I have pulled that code into the function ieee80211_rssadapt_choose
so that I can re-use it in ath(4), atw(4), and in other drivers.
In rssadapt(9), I have also created a struct ieee80211_rssadapt_expavgctl
that contains parameters for rate adaptation. When IEEE80211_RSSADAPT_DEBUG
is enabled, I will using sysctl to expose an ieee80211_rssadapt_expavgctl
for each wireless device.
Also in rssadapt(9), I have introduced an interpolate() macro which
makes the exponential-averaging code more compact.
denote a signed dBm Rx power, so rename them to _DBM_ and change
the signedness. Add new _DB_ flags for unsigned Rx power measured
from an arbitrary reference.
Try to synchronize net80211/ieee80211_radiotap.h with my tcpdump
sources (which public tcpdump has not seen, yet) and with FreeBSD.
802.11 drivers will use ieee80211_find_rxnode to match each received
packet with the ieee80211_node belonging to the sender. The driver
will use the ieee80211_node to track the sender's RSSI and other
statistics for, e.g., rate adaptation.
ieee80211_find_rxnode "fakes-up" missing ieee80211_nodes in IBSS
mode and in ad-hoc demo mode when it is appropriate. See the comments
in the source.
Also add ieee80211_find_txnode, which looks up the ieee80211_node
belonging to a MAC destination. ieee80211_find_txnode will also
fake-up missing nodes in IBSS/ad-hoc demo mode.
In ieee80211_encap, use ieee80211_find_txnode. This fixes the bug
in ad hoc packet-transmission reported by Greg Troxel, Urban Boquist,
and Kurt Schreiner.
Adaptation Strategy for IEEE 802.11 WLAN via Received Signal Strength
Measurement" by Javier del Prado Pavon and Sunghyun Choi. This
module should provide faster adaptation and higher throughput than
Lucent's rate-adaptation scheme.
Individual drivers need to be modified to use this module. Patches
for wi(4) are forthcoming.
a different BSS, because that keeps drivers like atw from detecting
ad hoc beacons with the same SSID but different BSSID for the
purpose of IBSS merges.
This should be revisited: maybe drivers should check for beacons
before handing packets up with ieee80211_input(). However, this
restores the atw(4) to working like it did with the old 802.11
layer, and it *is* nice to re-use the 802.11 layer's packet-decode
& -dispatch code (i.e., the ic_recv_mgmt callback).
* Add Kevin Lahey's power-saving support from the old 802.11 layer
* Support for frequency-hopping PHYs
* Add support frequency-hopping PHY mode, IFM_IEEE80211_FH
* Add channel flags for frequency-hopping
* Add mode<->media mappings in for FH PHY in ieee80211_media2rate
and ieee80211_rate2media
* Stop using IFM_MAKEMODE macro since the mode constants
(e.g., IFM_IEEE80211_11A) are pre-shifted in sys/net/if_media.h
* Add some PLCP constants.
* Add Kevin Lahey's power-saving support from the old 802.11 layer
* Add a FHPARMS or DSPARMS info element to probe responses and beacons
as appropriate.
* Add Kevin Lahey's power-saving support from the old 802.11 layer
* Add my stop-gap rate-selection routine, ieee80211_get_rate,
from the old 802.11 layer
* Also from the old 802.11 layer: factor ieee80211_match_bss out
of ieee80211_end_scan, since atw(4) uses it for IBSS merges.