Commit Graph

205 Commits

Author SHA1 Message Date
sam
836efd552e mark stations authorized during recv processing instead of doing it
as a side effect of sending an auth success frame; sending mgmt
frames should not have side effects
2005-06-10 05:04:42 +00:00
sam
a161b6a7bc move AID implementation defines from the protocol definitions to
where they are used
2005-06-10 04:42:34 +00:00
sam
d6dd7e9d2a accept diassoc frame in ASSOC state 2005-06-10 04:37:05 +00:00
sam
f524fb8e7d pull some debug msgs up so they're seen more often 2005-06-10 01:48:57 +00:00
sam
6bac24f11a kick the state machine when we receive failure notice from an ap (when
operating in sta mode); this speeds up the state machine, previously
we were acting on a timeout
2005-06-10 01:47:28 +00:00
sam
78c35576de discard open auth requests in adhoc mode 2005-06-10 01:43:28 +00:00
sam
afe76ba36a reject open auth requests when shared key auth is configured
Obtained from:	Atheros
2005-06-10 01:41:59 +00:00
sam
87f793a9fe add ieee80211_send_error to encapsulate an idiom 2005-06-10 01:40:58 +00:00
sam
07fc2e05e9 o always check if ic_set_tim is !NULL before using it
o add missing call to clear tim after flushing ps q
2005-06-10 01:38:02 +00:00
sam
e32bb658a4 mark state for protection only when operating in 11g 2005-06-10 01:35:21 +00:00
sam
cbf7030d15 don't reject station based on the PRIVACY bit in the capabilities;
the 802.11 spec says not to

Obtained from:	Atheros
2005-06-10 01:33:47 +00:00
sam
adbfe7192e correct checks for rate set compatibility 2005-06-10 01:31:28 +00:00
sam
7b2e90955c record tstamp from beacons received in station mode when associated;
this is needed by drivers that want to resync their timers based on
the tsf of the last recv'd beacon frame
2005-06-10 01:29:21 +00:00
sam
0a48913a6f o collect dtim period+count from beacons in station mode so drivers
can better program beacon timers
o leave placeholder in com structure for future ap/adhoc mode tim support

Reviewed by:	avatar
2005-06-09 04:05:43 +00:00
sam
2a3c2a37f6 Change the MLME ASSOCIATE ioctl to accept either a ssid, a bssid,
or a bssid+ssid. This is needed for later versions of wpa_supplicant
and for forthcoming addons to wpa_supplicant.

Note this is an api change and applications must be rebuilt.
2005-06-07 23:37:49 +00:00
sam
b04dca4ae5 Don't clock the state machine in various cases when roaming is set
to manual; this helps keep wpa_supplicant in sync.
2005-06-07 23:31:36 +00:00
sam
24d4beb312 WPA/802.11i interoperability fixes:
o only include capabilities word in the WPA ie when non-zero and
  not preauth
o always include the capabilities in the RSN ie

Obtained from:	Atheros
2005-06-07 00:08:48 +00:00
sam
5bab97118d add force flag to enmic/demic crypto api for use in xmit fragmentation
and h/w mic verification

Reviewed by:	avatar
2005-06-06 04:04:38 +00:00
sam
8ace9dabca Revise crypto api lightly to improve group key handling:
o don't pre-assign key index to the global key table entries so device
  has a chance to decide what to use
o make ieee80211_crypto_newkey take the desired flags as an argument
  instead of wacking the key structure directly; this eliminates a
  bunch of code warts
o add a new flag IEEE80211_KEY_GROUP to indicate a key is a WPA Group
  key so devices don't need to guess (temporarily add this flag in the
  ioctl code until we can get wpa_supplicant+hostapd updated)
o shuffle IEEE80211_KEY_* bits to move flags used internally to the high
  nibble of the flags word

Reviewed by:	Tai-hwa Liang
2005-04-12 17:55:13 +00:00
sam
4a61af733a remove extern from function decls 2005-04-04 04:27:20 +00:00
sam
2425695845 change ieee80211_input to return the frame type or -1 2005-04-04 02:32:56 +00:00
sam
50f9633899 pass re-association events up using a new message type 2005-03-29 19:36:42 +00:00
sam
eabc12aec2 when WPA is enabled discard association requests w/o a WPA ie
Submitted by:	Divy Le Ray
2005-03-26 07:15:34 +00:00
sam
262d235182 don't include wme ie in probe request frames; it was meant for probe response
frames--move it there

Noticed by:	Ghislain Mary
Submitted by:	Michael Wong
2005-03-26 07:11:31 +00:00
sam
c0c5a03a41 correct comparison for null ptr
Noticed by:	Coverity Prevent analysis tool
2005-03-16 20:42:00 +00:00
sam
9b7f94f833 avoid potential array index by -1
Noticed by:	Coverity Prevent analysis tool
2005-03-16 20:40:48 +00:00
sam
0ea8247d55 eliminate use after free in debug code
Noticed by:	Coverity Prevent analysis tool
2005-03-16 20:39:05 +00:00
sam
bddcc80ceb kill dead code
Noticed by:	Coverity Prevent analysis tool
2005-03-16 20:35:23 +00:00
sam
228aadaa15 honor any desired bssid when creating an ibss
Prodded by:	David Young
Obtained from:	netbsd
2005-03-08 17:04:14 +00:00
wpaul
8afa2c4c26 Recently, it was reported to me that you could provoke a double fault
panic with the NDISulator if you did "ifconfig ndis0 10.0.0.1/24,"
whereas "ifconfig ndis0 10.0.0.1/24 up" worked fine. The double fault
was caused by the ifconfig thread running out of kernel stack space.
(This was partly due to the NDIsulator using a couple of big buffers on
the stack, but even after fixing that the double fault persisted.)

It turns out that ndis_init() is called in both cases, but in the first
case the code path passes through ieee80211_ioctl(), and it turns out
ieee80211_ioctl() consumes a whopping 2400 bytes of stack space.
Apparently, gcc -O2 causes the ieee80211_ioctl_get80211() routine to
be inlined into ieee80211_ioctl(), and for some reason which I do not
fully understand, this causes ieee80211_ioctl() to consume an extra 2K
of stack space.

To prevent this overly agressive optimization, ieee80211_ioctl_get80211()
is now declared with __attribute__ ((noinline)). With this change,
ieee80211_ioctl() now only reserves about 200 bytes of stack instead of 2400.
2005-03-03 17:35:05 +00:00
sam
9b2bcce14f mark timestamp for pending fragments
Noticed by:	Jeffrey D. Chung
2005-02-23 04:52:30 +00:00
sam
bfba17efd6 rev 1.19 fixed wpa supplicant but broke wpa authenticator; when operating
as an authenticator need to always check for the unicast key in the node
(as was the case before)

Submitted by:	Divy Le Ray
2005-02-10 17:00:48 +00:00
sam
9b44db51a1 propagate state kept in the bss node when re-creating the node
on state transitions; this is a stopgap measure, need to rethink
how we do management of this state

Identified by:	Divy Le Ray
2005-02-10 16:59:04 +00:00
sam
a1edfec034 correct check for unicast key being setup; wpa_supplicant in particular
uses only the global key state so looking in the per-node key slot is wrong

Submitted by:	Tai-hwa Liang
2005-02-03 16:21:07 +00:00
sam
217734da84 supply a default ic_reset method for drivers; the ioctl code expect this
method to always be setup

Submitted by:	Tai-hwa Liang
2005-01-27 17:39:17 +00:00
sam
e0b285228a update node reference count debug msgs to include the node address
since the mac address may not be sufficient to uniquely identify a node
2005-01-24 20:50:20 +00:00
sam
a55551873c clear IEEE80211_F_WMEUPDATE when building the initial beacon frame so we
don't do an update on the first beacon
2005-01-24 20:41:12 +00:00
sam
c504db8755 noop change so RUN->RUN transition isn't considered invalid
(it happens on ibss merge)
2005-01-24 20:39:29 +00:00
sam
d07ff12dc9 add macros to convert between txop's and usecs 2005-01-24 20:38:26 +00:00
sam
01ce092a3a o clarify that beacon interval settings are in TU's, not ms
o add macros to convert between TU's and ms
2005-01-24 19:39:07 +00:00
sam
459bcc3dba statically allocate the station/neighbor node table; the deferred
allocation scheme introduced a race condition during device state
transitions
2005-01-24 19:32:10 +00:00
sam
822cad40f8 handle potential stale values of bssid in neighbor nodes that
can occur after an ibss merge

Submitted by:	David Young
2005-01-22 20:33:37 +00:00
sam
7a9676cb41 when ssid suppression is enabled don't respond to probe requests
unless our ssid is specified
2005-01-22 20:31:22 +00:00
sam
78282d6a1d be consistent in naming inactivity timers;
net.wlan.X.inact -> net.wlan.X.inact_run
2005-01-22 20:29:23 +00:00
sam
c1c8fdfa03 o replace out-of-line copy of FCS w/ a flag that indicates the
frame includes FCS (requires applications to be updated, but since
  we weren't doing the out-of-line FCS stuff anyway app changes
  were needed already)
o add a flag to indicate padding exists between the 802.11 header and
  the payload (e.g. for Atheros cards)
o diff reducation against netbsd

MFC after:	1 week
2005-01-22 20:12:05 +00:00
sam
8ec9f729de when a station is timed out for inactivity, remove it from the table
so it isn't considered again
2005-01-20 02:59:21 +00:00
sam
3973fcd768 explicitly avoid timing out ourself due to inactivity; it
can easily happen if the bss is quiet
2005-01-20 02:54:18 +00:00
sam
2b292030fb fix refcnt leak in adhoc mode: entries in the neighbor table
created due to rx'd frames had an extra reference
2005-01-20 02:53:11 +00:00
sam
2138a8301b remove debug msg from ieee80211_iterate_nodes; it makes logs very noisy
as onoe rate control invokes this once a second
2005-01-18 20:35:39 +00:00
sam
ff12c179c8 avoid possible null pointer deref when refcnt debugging is enabled; the
node may be orphaned

Submitted by:	Tai-hwa Liang
2005-01-18 20:34:22 +00:00
sam
ae59d17866 Explicitly ignore ibss merge requests when the node is ic_bss. This can
happen on the first management frame received from a neighbor; we assume
any merge candidate will send more frames and those should be processed
with a suitable table entry.

Stepped on by:	Tai-hwa Liang
2005-01-18 20:30:16 +00:00
sam
c32261430c Simplify the logic for checking the scan candidates at the end of a scan.
Hold a lock on the table instead of futzing with reference counts which
was potentially dangerous except drivers were quiescent while we did this
so the table contents never changed.  Disable the hack logic for removing
scan candidates with multiple association failures; it's never done the
right thing and will be fixed correctly with background scanning goes in.
2005-01-18 20:21:29 +00:00
sam
6495462157 correct logic that caused beacon frames received in ibss mode to be
discarded when not scanning
2005-01-18 20:07:44 +00:00
sam
07d33c069a move beacon/probe response counting down to after we've decided whether or
not we're going to process the frame; this makes the counters reflect frames
actually processes instead of received (discarded frames were already counted)
2005-01-18 20:04:51 +00:00
sam
4c9a185523 when scanning is interrupted reset state so table entries go in the station
table and not the scan table

Noticed by:	Tai-hwa Liang
2005-01-18 19:59:40 +00:00
sam
5d86ecca9f do fixed rate check when considering if a scan candidate is suitable so when
it's time to join the bss we can't get an error
2005-01-18 19:52:36 +00:00
sam
8af7e8df05 Correct scan candidate selection logic for dual-band devices: prefer
candidate on 5Ghz channel to candidate on 2Ghz channel only when the
rssi are comparable (wasn't considering rssi).
2005-01-01 17:48:27 +00:00
sam
c5bfbdb959 remove netbsd rcsid lines; they are way out of date and we appear to be
diverging too much to make tracking these files worthwhile
2004-12-31 22:44:26 +00:00
sam
14fee97914 bump copyright for 2005 2004-12-31 22:42:38 +00:00
sam
141330c912 fixup inactivity timers:
o ic_inact_auth is a bad name, it's the inactivity threshold
  for being associated but not authorized; use it that way
o reset ni_inact when switching inactivity thresholds to
  minimize the race against the timer (don't want to lock
  for this stuff)
o change the inactivity probe threshold from a one-shot to
  cover a range: when below this threshold but not expired
  send a probe each inactivity interval; should probably
  guard against the interval being turned way down as this
  could cause us to spam the net with probes
2004-12-31 22:05:13 +00:00
sam
7c448457f6 Relearn how WPA keying is supposed to work and fix WPA+WME while
we're at it:
o WPA/802.11i has a unicast key and a group key; in station mode
  everything is sent with the unicast key--we were consulting the
  destination mac address and incorrectly using the group key
o (perpetuate fallback use of the default tx key to maintain
  compatibility with the way wpa_supplicant works)
o correct EAPOL encryption logic to check unicast key instead
  of assuming other state implies this
o move QoS encapsulation up to before enmic work so TKIP has the
  information required to calculate the pseudo-header
o do not do QoS-encapsulation of EAPOL frames as some ap's do the
  wrong thing with such frames (may need to revisit this if ap's
  start dropping non-QoS frames from stations assoc'd with QoS)
o move ieee80211_mbuf_adjust closer to its caller
2004-12-31 21:54:53 +00:00
sam
5a21ccb974 disable default use of wme until we can sort out interoperability issues;
users that want it can explicitly enable it
2004-12-31 21:48:15 +00:00
sam
fe8d9eb613 s/inline/__inline/ 2004-12-31 21:30:42 +00:00
sam
fe545f4516 compare pointers against NULL 2004-12-31 21:28:41 +00:00
sam
bb13d71061 make ap mode sta association debug msg as informative as sta mode 2004-12-31 21:27:53 +00:00
sam
95f27e450d do 11g erp station management in turboG mode too 2004-12-31 21:25:28 +00:00
sam
2cf886f5dc check if the node/station table is already present before creating one; this
can happen on an ibss merge
2004-12-31 21:22:12 +00:00
sam
886afd7287 include phy mode in scan debug msg 2004-12-31 21:19:59 +00:00
sam
e1832f531b accept IEEE80211_KEYIX_NONE for a default tx key 2004-12-31 21:13:35 +00:00
sam
d54bd57731 don't return prematurely from processing a beacon or probe response frame
when associated; this corrects a problem where doing a scan while associated
caused the associated ap to sometimes not be included in the scan set
2004-12-31 21:11:59 +00:00
sam
f249744499 change ieee80211_parse_wmeparams to return a unique value when the ie
is invalid so we can distinguish this from needing a parameter update;
fixes dynamic update of wme parameters
2004-12-31 21:09:43 +00:00
sam
59c07f15bb remove stray \n from debug msg 2004-12-31 21:05:05 +00:00
sam
d5e5ef7858 clear wep bit in 802.11 header after crypto decap so packet
capture doesn't see it
2004-12-31 21:04:05 +00:00
sam
8c3a1cf5aa o add net.wlan.X.driver_caps mib variable for setting the driver capabilities
flags for testing
o debug msg consistency fixups
2004-12-31 21:01:41 +00:00
sam
e508073ee6 correct pseudo-mic header calculation for QoS frames 2004-12-31 20:59:03 +00:00
sam
4327f1ee6e whitespace/debug msg fixups 2004-12-31 20:58:06 +00:00
sam
83e6bc9990 add ieee80211_hdrspace and ieee80211_anyhdrspace to calculate the space
for an ieee80211 header taking into account padding requirements
2004-12-31 20:56:32 +00:00
sam
886a744d99 correct header length calculations on tx path for QoS-encapsulated frames
when IEEE80211_F_DATAPAD is set (e.g. ath); must use ieee80211_hdrspace
instead of ieee80211_hdrsize
2004-12-31 20:51:41 +00:00
sam
0b07314057 const'ify ivp reference 2004-12-31 20:44:15 +00:00
sam
ae02e9bff7 add/fixup debug msgs 2004-12-31 20:42:51 +00:00
sam
dfe3a547e6 s/inline/__inline/ 2004-12-31 20:39:41 +00:00
sam
11042819f1 expose ieee80211_phymode_name for use in debug msgs 2004-12-31 20:38:48 +00:00
sam
dfbb715550 correct module dependency 2004-12-13 18:26:13 +00:00
sam
18549dae69 correct module dependency 2004-12-13 18:12:26 +00:00
sam
e3a33be489 cover up the landmine until there's a proper solution 2004-12-13 04:26:36 +00:00
sam
dc4ceb7b98 do not clear the global key cache when reaching the INIT state 2004-12-12 05:00:13 +00:00
sam
27e1f2c5b3 remove module dependency on rc4; it's not needed any more 2004-12-12 00:28:41 +00:00
sam
42039c0abf fix wep key seting: ENETRESET is the code to return to signal the driver
should push software state to the hardware (was ERESTART which caused the
system call to be retried)

Submitted by:	Tor Egge
2004-12-10 16:35:37 +00:00
sam
0ea4584f3c fixup printf arguments for 64-bit machines 2004-12-08 22:34:07 +00:00
sam
2843bf259e Update 802.11 support; too much new functionality to fully describe
here but it includes completed 802.11g, WPA, 802.11i, 802.1x, WME/WMM,
AP-side power-save, crypto plugin framework, authenticator plugin framework,
and access control plugin frameowrk.
2004-12-08 17:26:47 +00:00
rwatson
b463bc6c33 Add a new network interface flag, IFF_NEEDSGIANT, which will allow
device drivers to declare that the ifp->if_start() method implemented
by the driver requires Giant in order to operate correctly.

Add a 'struct task' to 'struct ifnet' that can be used to execute a
deferred ifp->if_start() in the event that if_start needs to be called
in a Giant-free environment.  To do this, introduce if_start(), a
wrapper function for ifp->if_start().  If the interface can run MPSAFE,
it directly dispatches into the interface start routine.  If it can't
run MPSAFE, we're running with debug.mpsafenet != 0, and Giant isn't
currently held, the task is queued to execute in a swi holding Giant
via if_start_deferred().

Modify if_handoff() to use if_start() instead of direct dispatch.
Modify 802.11 to use if_start() instead of direct dispatch.

This is intended to provide increased compatibility for non-MPSAFE
network device drivers in the presence of Giant-free operation via
asynchronous dispatch.  However, this commit does not mark any network
interfaces as IFF_NEEDSGIANT.
2004-07-27 23:20:45 +00:00
mlaier
977d97b004 Link ALTQ to the build and break with ABI for struct ifnet. Please recompile
your (network) modules as well as any userland that might make sense of
sizeof(struct ifnet).
This does not change the queueing yet. These changes will follow in a
seperate commit. Same with the driver changes, which need case by case
evaluation.

__FreeBSD_version bump will follow.

Tested-by:	(i386)LINT
2004-06-13 17:29:10 +00:00
phk
d6f7d2bde6 Add some missing <sys/module.h> includes which are masked by the
one on death-row in <sys/kernel.h>
2004-05-30 17:57:46 +00:00
andre
f083d45820 Link state change notification of ethernet media to the routing socket.
o The ieee80211_media_status() function updates the ifi_link_state field
  and calls rt_ifmsg() to notify listeners on the routing socket.

Approved by:	sam
2004-05-05 15:48:06 +00:00
sam
534a1c6c21 Resolve the issue of whether frames have FCS or not. Frame data does not
include FCS; if you want to provide it you can put it in the header.

Submitted by:	David Young
2004-04-05 22:13:21 +00:00
sam
95fbaa6dad eliminate nested include by making MALLOC_DECLARE conditional on the
inclusion of <sys/malloc.h>

Submitted by:	bde
2004-04-05 22:10:26 +00:00
sam
4bcffa477a add definitions for WME, WPA (and WPA2), and miscellaneous other stuff
that's coming soon

Obtained from:	madwifi
2004-04-05 17:47:40 +00:00
sam
0eac2dcc6f export the malloc type M_80211_NODE for drivers that override the node
allocation routines
2004-04-05 04:17:03 +00:00
sam
089385e207 make malloc tag for ieee80211_node more recognizable 2004-04-05 04:15:55 +00:00
sam
0a58f658fe Change handling of probe response frames. Previously we always dropped the
refcnt on the node but left it in the node table.  This allows the node table
to hold the results of scanned ap's but for ibss scans left nodes w/o any
driver-private state setup and/or a bad refcnt (when the nodes were timed
out they were prematurely discarded).  Now we treat nodes identified for ap
scanning as before but force nodes discovered when scanning for ibss neighbors
to have complete/proper state and hold the refcnt on the node.  Any other
nodes created because of these frames are discarded directly (need to optimize
this case to eliminate various work that's immediately discarded).
2004-04-02 23:35:24 +00:00