Commit Graph

131 Commits

Author SHA1 Message Date
dyoung 49cfbd0442 Drivers are not expected to call ieee80211_find_node_for_beacon,
so don't increase the reference count on a node before returning
it.
2004-10-04 07:35:48 +00:00
dyoung b01c9a3223 Bug fix: in ieee80211_find_txnode, we used to call ieee80211_ref_node(ni)
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.
2004-10-04 07:17:41 +00:00
enami a4ee532ba4 Adjust caller for net/if_ieee80211subr.c rev 1.11 change; the argument
`reassoc' is replaced with testing if the type is ..._REASSOC_REQ.
2004-09-07 01:07:40 +00:00
dyoung 90691ca787 Cosmetic: remove extraneous blank line. 2004-08-10 21:58:31 +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 2a134a8f3c Change the basic rate list for 11g to contain just the 11b modes, mimicking the
behavior of other systems.
2004-07-30 17:05:18 +00:00
dyoung 59380646e3 For interoperability with legacy equipment, do not enable short
preamble by default.
2004-07-30 04:32:10 +00:00
dyoung 8205ae2288 Change sysctl range-checking: net.link.ieee80211.debug values are
now 0x0 -> 0xffffffff, not 0 -> 2.
2004-07-30 04:29:52 +00:00
mycroft 198c3a9495 Whoops, rearrange the function so the TAILQ_EMPTY() DTRT. 2004-07-29 23:17:29 +00:00
mycroft 3fbc463c40 Don't reset the inactivity timer every time we create a node -- this could
cause us to stall and never time out anything.
2004-07-29 22:59:19 +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 1d27a29121 Always lookup/create a node table entry for Beacons and Probe
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.
2004-07-28 08:11:03 +00:00
mycroft feabadd671 The adhoc mode changes are seriously broken. In host-AP mode, at least, we
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.
2004-07-26 16:31:47 +00:00
dyoung f704e633b9 Call ieee80211_free_node, not ieee80211_node_leave, on timed-out
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.
2004-07-25 05:21:36 +00:00
dyoung 4388de1ef5 Undo last: Sam Leffler has shown me a better way to avoid ad hoc
lossage.
2004-07-25 05:08:33 +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
dyoung bd6e05d5bd ieee80211_node_leave runs in all modes, not just hostap mode, so
it must not IASSERT that it is in hostap mode.
2004-07-24 04:44:51 +00:00
dyoung 3fcb69ddbf NetBSD does not define ieee80211_node_refcnt(). Use ni->ni_refcnt,
instead.
2004-07-24 04:07:01 +00:00
mycroft daed6ac762 First part of this file -- ieee80211_node locking macros. 2004-07-23 10:16:00 +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 e47eed0be7 Hide some code behind an #ifdef IEEE80211_DEBUG. 2004-07-23 08:38:08 +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
dyoung a70c2acfb1 Don't #define IEEE80211_DEBUG here. 2004-07-23 07:24:21 +00:00
dyoung e135a8a4a9 Fix ieee80211_needs_rxnode so that net80211 does something akin to
a passive scan for APs and IBSSs, always, but without visiting new
channels.
2004-07-23 06:57:33 +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 5b42102f70 Don't be so repetitive repetitive in the ieee80211_needs_rxnode
synopsis.
2004-07-23 05:54:02 +00:00
mycroft c3138ef3da IEEE80211_MAX_AID has been renamed to IEEE80211_AID_MAX. 2004-07-23 05:33:41 +00:00
mycroft de64f03a72 Sync with madwifi. 2004-07-23 05:33:23 +00:00
dyoung 754d58a536 Bug fix: in ad hoc mode, the principle of least surprise demands
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.]
2004-07-23 05:19:41 +00:00
dyoung 218f34f115 Protect userland from some of the definitions with #ifdef _KERNEL.
Thank you, Havard Eidnes, for the pointing out my oversight.
2004-07-22 17:04:38 +00:00
mycroft eec7430f97 In *_fix_rate(), set ni_txrate to the highest common speed so that probe
and authentication responses are sent with a sensible speed.  XXX
2004-07-22 14:52:07 +00:00
mycroft 427f7b9264 The low-level drivers are not setting the "basic rate" bit in the rateset.
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).
2004-07-22 14:44:17 +00:00
dyoung 9946103dce Add sysctl access to 802.11 node tables, step #2. 2004-07-16 03:02:41 +00:00
dyoung cb049b8c75 Add sysctl access to 802.11 node tables, step #1. 2004-07-16 03:01:09 +00:00
dyoung 22b2f98500 Move ieee80211_channel definition and channel flags into
ieee80211_channel.h, step #2.
2004-07-16 02:57:32 +00:00
dyoung d5a069fe39 Move ieee80211_channel definition and channel flags into
ieee80211_channel.h, step #1.
2004-07-16 02:56:50 +00:00
dyoung 74d2bb365f Straggler: *really* chain the ieee80211coms. 2004-07-16 02:54:05 +00:00
dyoung e5c3be4f90 Send "no carrier"/"active" indications on the routing socket when
(most) 802.11 interfaces change state.
2004-07-16 02:38:34 +00:00
dyoung d18cdaab4e Chain ieee80211coms together so that the 802.11 sysctls can walk
them all to retrieve their node tables.
2004-07-16 02:36:58 +00:00
dyoung 4021fab89e Remove a few levels of indentation in ieee80211_find_rxnode by
return'ing early.
2004-07-02 23:54:08 +00:00
dyoung b0ce431f32 Add sysctl(9) descriptions for net.link and net.link.ieee80211. 2004-06-06 05:45:29 +00:00
dyoung 390d3859bf Fix a typo in some #ifdef notdef code. 2004-06-06 05:44:25 +00:00
dyoung 7b92b29893 Improve argument checking. Convert from seconds to some number of
inactivity countdown intervals (currently these are 5 seconds).
2004-06-06 05:43:17 +00:00
dyoung e071e08cc6 Fix for kern/25604: ifconfig wi0 media DS11 panics system.
In ieee80211_chan2mode, do not dereference the marker for "any
channel," IEEE80211_CHAN_ANYC.
2004-06-06 05:28:58 +00:00
dyoung 50c193fc53 Define IEEE80211_RADIOTAP_HDRLEN, the length of a radiotap header. 2004-06-06 04:13:28 +00:00