Commit Graph

39 Commits

Author SHA1 Message Date
christos a1f8461e23 avoid shadowing of m1 2005-05-30 04:16:10 +00:00
perry f07677dd81 nuke trailing whitespace 2005-02-26 22:45:09 +00:00
dyoung a4bb6a73ed Fix a misuse of ether_sprintf so that IBSS merges are printed
xx:xx:xx:xx:xx:xx -> yy:yy:yy:yy:yy:yy instead of
xx:xx:xx:xx:xx:xx -> xx:xx:xx:xx:xx:xx.
2005-01-16 11:36:54 +00:00
dyoung 5dc6377838 IBSS-merge clean-up, inspired by some Linux patches from Jon Anderson
(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.
2005-01-04 00:56:51 +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 8e9a02ab5e Put a check for an impossible case inside '#ifdef DIAGNOSTIC'. 2004-07-30 17:45:21 +00:00
mycroft 88a8480ea3 Implement passive scanning for APs in station and host-AP mode:
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.)
2004-07-29 22:28:05 +00:00
dyoung 6f9ff5e059 Vastly simplify ieee80211_ibss_merge, eliminating the needless
callbacks.  Change the reference IBSS-merge implementation in atw
to match.
2004-07-28 08:12:49 +00:00
dyoung ce488d2bf7 Pull the IBSS merge logic out of atw and into net80211, since ath
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).
2004-07-24 23:53:49 +00:00
mycroft f526e7326b Cleanup of ieee80211_node from madwifi:
* Don't use ifp pointers; use ieee80211com.
* Implement the locking macros that are used under FreeBSD and Linux.
2004-07-23 10:15:13 +00:00
mycroft 3551583171 Changes from madwifi:
Abstract some of the node management code into separate functions, and use them
throughout, plugging memory leaks.
Allocate the AID allocation map dynamically.
2004-07-23 09:22:15 +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 a02b46e848 More diff reduction; mainly IEEE80211_DPRINTF() stuff. 2004-07-23 08:05:00 +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 c9f71eaeb7 Prevent ad hoc lossage: copy the SSID from a beacon into the
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.
2004-05-31 11:12:24 +00:00
dyoung 1ff6496e8c Incorporate new authentication debug statements from FreeBSD.
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.)
2004-05-06 02:56:48 +00:00
dyoung 1d6dd12bbb From FreeBSD. Be more consistent with ieee80211_node
reference counts, and treat ad hoc nodes properly.  More complete
authentication support.
2004-04-30 23:58:08 +00:00
mrg b8931a9257 fix int/size_t issues in debug code. 2004-02-11 10:19:32 +00:00
dyoung c4ac88ea48 This patch from Sam Leffler fixes bugs in the client-side of
shared-key authentication. This should help with your Apple products.
Any bugs, new or old, are mine.
2004-02-01 08:25:57 +00:00
onoe b001a515f8 For FH phy, accept beacons whose hop pattern in FH params is different
from current setting, because the rssi value would be correct once the
datagram is received regardless the hopping pattern.
2004-01-15 08:16:24 +00:00
dyoung 5bcaa60a0e Don't panic on frames without a second address field. Tap them for
BPF, instead.
2004-01-14 04:11:09 +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 4232da0fda Diagnostics: complain if packet decapsulation fails. 2003-12-07 05:34:22 +00:00
mycroft c41a3efdb2 Eliminate bogus initializer. 2003-10-27 17:11:19 +00:00
christos 2017bf9a94 Fix uninitialized variable warning 2003-10-25 18:31:59 +00:00
mycroft f336bf5b29 Do that replacement in one more place. 2003-10-25 03:18:37 +00:00
mycroft 3ebaf267f3 Replace a constant with a symbol. 2003-10-25 01:17:39 +00:00
dyoung 38a484b2d0 In the input path, do not discard management frames belonging to
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).
2003-10-23 06:30:32 +00:00
itojun e0c9ee7f93 print "association failed" message only if IFF_DEBUG 2003-10-18 05:06:43 +00:00
onoe ba543e3743 Do not update SSID by beacon, because hidden SSID implementation is vary.
ex. 0-length, single space, 0x00 with correct length.
So, we don't update SSID in node table by beacon, but always update by
Probe Response.
2003-10-18 03:33:51 +00:00
dyoung db0e43b296 Add WEP shared-key authentication. 2003-10-15 11:43:51 +00:00
dyoung 0fc2b8e13f Add missing pktattr declaration. Should compile w/ ALTQ, now. 2003-10-14 23:02:52 +00:00
dyoung b8e804e8d2 Add Kevin Lahey's power-saving support from the old 802.11 layer
Spelling fix: s/unmatch/mismatch/g
2003-10-13 04:25:26 +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 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