Commit Graph

28 Commits

Author SHA1 Message Date
perry f07677dd81 nuke trailing whitespace 2005-02-26 22:45:09 +00:00
dyoung 89e3661699 Bug fix: when encapsulating 802.11 data packets, always copy the
BSS node's BSSID into the frame header.  It is incorrect to copy
in the neighbor's BSSID because it may be out of date following an
IBSS merge.
2005-01-21 22:57:30 +00:00
dyoung 07a485e480 Cosmetic: shorten a staircase. 2005-01-16 11:37:58 +00:00
dyoung 4c03aed52f In ieee80211_getmbuf, remove the #ifdef __FreeBSD__ code. Check
for MCLGET success using the (m->m_flags & M_EXT) idiom.
2005-01-04 00:36:18 +00:00
dyoung 45d5300ab2 Cosmetic: remove some dead code. Join some lines. 2004-12-27 10:47:57 +00:00
dyoung 07e67ea7d6 802.11 Control/multicast/broadcast packets are not acknowledged.
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.
2004-12-27 09:25:05 +00:00
mycroft e3c9106a08 Simplify the duration calculations somewhat.
* 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.
2004-12-27 05:35:33 +00:00
mycroft 9fc969bfcb Update a comment. 2004-12-27 01:57:58 +00:00
mycroft 06e4fe7f62 Replace d_plcp_svc with d_residue. The latter is the number of whole
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.
2004-12-27 01:51:49 +00:00
dyoung 24ba04b962 Fix a bug in ieee80211_compute_duration: the 802.11 Duration field
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.
2004-12-23 06:08:52 +00:00
dyoung 81eefc6f1a Define for more bits in the Service field of the 802.11 PLCP Header.
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.
2004-12-19 08:08:06 +00:00
dyoung 8abb07d1ac Make the node table into an LRU cache: least-recently used nodes
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.
2004-08-10 00:57:20 +00:00
mycroft 50d44f4f07 IEEE80211_F_WEPON -> IEEE80211_F_PRIVACY 2004-07-23 08:31:39 +00:00
mycroft 75f8366d87 Yet more DPRINTF() cleanup. 2004-07-23 08:25:25 +00:00
mycroft f0546001c6 Diff reduction vs. madwifi.
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.
2004-07-23 06:44:55 +00:00
dyoung a49a69d67a If WEP is on, set a data packet's WEP flag when we 802.11-encapsulate
it.  Credit: Matthew Gream.
2004-05-31 11:02:55 +00:00
dyoung 974bfde812 From FreeBSD. Increase a stats counter when
ieee80211_find_txnode fails.
2004-04-30 23:58:17 +00:00
dyoung 8c117e1a38 NetBSD's KASSERT takes just one argument while FreeBSD's takes two,
so I have added IASSERT(cond, complaint) to the compatibility header
file and s/KASSERT/IASSERT/'d.
2004-01-13 23:37:29 +00:00
dyoung 9280f4b428 Synchronize with FreeBSD sources from 12 Dec 2003. 2003-12-14 09:56:53 +00:00
dyoung 22f9e4aae7 On the output path, save a power-saving station's ieee80211_node
in the mbuf's rcvif field so that the driver can get at it.
2003-11-02 00:17:27 +00:00
dyoung 3ed4d1ac9f Add ieee80211_find_rxnode and its helper ieee80211_needs_rxnode.
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.
2003-10-29 21:50:57 +00:00
dyoung db0e43b296 Add WEP shared-key authentication. 2003-10-15 11:43:51 +00:00
dyoung 031c73f68c Even more changes to the new 802.11 layer:
* 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.
2003-10-13 04:22:55 +00:00
dyoung c059ea0028 More NetBSD-FreeBSD compatibility changes in the pattern
#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.
2003-09-28 02:35:20 +00:00
dyoung 6e8d0b71c8 Insert RCSIDs. 2003-09-14 01:14:54 +00:00
dyoung 50fa2c1f44 Complete merge. 2003-09-07 04:10:39 +00:00
dyoung cf8438b460 First stab at producing a unified NetBSD/FreeBSD 802.11 layer,
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
2003-09-07 01:22:19 +00:00
dyoung 40e261aa72 Pull in net80211/ from FreeBSD. This contains Sam Leffler's
enhancements to the 802.11 layer, which are necessary for ath(4),
the Atheros-chipset driver.
2003-08-30 21:26:03 +00:00