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.
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.
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.
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.
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.
* 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.
#ifdef __FreeBSD__
/* FreeBSDism */
#else
/* NetBSDism */
#endif
An important and non-obvious change is in ieee80211_mgmt_output,
#ifdef __FreeBSD__
KASSERT(m->m_pkthdr.rcvif == NULL, ("rcvif not null"));
#endif
Because NetBSD mbufs are not bzero'd like FreeBSD's, we cannot
count on rcvif == NULL.
striving to keep the diffs short and simple.
* Replace FreeBSDisms (e.g. struct arpcom) with conditionally-compiled
NetBSDism (struct ethercom).
* Add compatibility shims in ieee80211_compat.*: provide NetBSD with
if_printf, for example.
* Convert FreeBSD node mutex uses to generic node critical-section
protection (ieee80211_node_critsect_begin, _end), replace
FreeBSD atomic arithmetic with generic alternative, and implement
generics in NetBSD
* Provide NetBSD-style 802.11 ioctls
* Style nits