Commit Graph

260 Commits

Author SHA1 Message Date
dyoung c511c45965 Don't load the ic_bss node into the sysctl result twice, as we
would do in IBSS mode if the ic_bss had not expired from the
scan/neighbor node-table.
2005-07-03 20:44:46 +00:00
dyoung c0a74e44c8 rtw: Try to get hardware WEP to work. It seems to work in
the RX direction, but not in the TX direction.  The
	  net80211 crypto framework doesn't seem to cope very well
	  with the assymetry (I'm probably missing something), so
	  I will use software WEP for now.

net80211: In ieee80211_compute_duration, figure out whether to add
	  the WEP header to the packet overhead by checking the
	  WEP bit in the Frame Control field of the 802.11 header,
	  instead of checking the IEEE80211_F_PRIVACY flag.

	  Also, if the WEP bit is present, assume that the frame
	  described by (wh, len) has already already been WEP
	  encapsulated, and adjust the payload length accordingly.
	  XXX that's a grotty hack that I will have to revisit,
	  later.
2005-06-27 05:49:13 +00:00
erh 1b6f9cc263 Make sure there is a valid transmit key, before trying to use information
about it.  Fixes a crash when configuring wi0.
2005-06-26 21:51:37 +00:00
dyoung 9a7ebfdde9 Add some debug messages to ieee80211_notify_node_{join,leave}.
Change the way we walk 802.11 peers/clients: for each eligible
interface, walk the ic_sta (peers/clients) table, first; walk the
ic_scan (scan results) table, second; then visit the ic_bss (node
for the network joined/created by the interface).
2005-06-26 04:34:43 +00:00
dyoung 74988b0f25 Do not build AP support if 'options IEEE80211_NO_HOSTAP'. I will
use this in the INSTALL kernel to save some space.
2005-06-26 04:31:51 +00:00
martin adc4b94498 Remove unused <atomic.h> include; add <sys/device.h> includes where
needed.
2005-06-22 22:07:48 +00:00
dyoung 9063402978 Resolve conflicts in importation of 18-May-2005 ath(4) / net80211(9)
from FreeBSD.  Introduce compatibility shims (sys/dev/ic/ath_netbsd.[ch],
sys/net80211/ieee80211_netbsd.[ch]).  Update drivers (an, atu, atw,
awi, ipw, iwi, rtw, wi) for the new net80211(9) API.
2005-06-22 06:14:51 +00:00
dyoung 3cdc4fcd5f Import FreeBSD's net80211(9) of 2005-05-18 2005-06-21 20:37:38 +00:00
atatat df13e3579e Change the rest of the sysctl subsystem to use const consistently.
The __UNCONST macro is now used only where necessary and the RW macros
are gone.  Most of the changes here are consumers of the
sysctl_createv(9) interface that now takes a pair of const pointers
which used not to be.
2005-06-20 02:49:18 +00:00
atatat 420d91208b Properly fix the constipated lossage wrt -Wcast-qual and the sysctl
code.  I know it's not the prettiest code, but it seems to work rather
well in spite of itself.
2005-06-09 02:19:59 +00:00
christos b71716c913 Unconst sysctl_query... hi atatat 2005-05-30 04:16:56 +00:00
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 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 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 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 eeb33155cd Fix a typo. 2005-01-04 00:34:58 +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 1989546a4c GC unused stuff. 2004-12-27 05:36:08 +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 8828aae46c #define the difference in microseconds between a fast and a slow
preamble and PLCP header.
2004-12-23 05:25:41 +00:00
dyoung 8fff1555a5 Add SIOCG80211ZSTATS to atomically get/clear 802.11 statistics.
Protect SIOCG80211STATS with splnet()/splx() so that it takes a
"snapshot" of the 802.11 statistics, which is superfluous if
ieee80211_ioctl is always called at splnet()....
2004-12-20 23:03:39 +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 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
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 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
atatat 4de3747b89 Sysctl descriptions under net subtree (net.key not done) 2004-05-25 04:33:59 +00:00
dyoung 7412e6e599 In ieee80211_find_rxnode, when we "fake up" a node for an ad hoc
peer, we have to copy the "master" rate table to the faked-up node's
rate table, or else ath0 will complain, "ath0: bogus xmit rate
0x0".  Thank you Konstantin KABASSANOV for reporting this problem.
2004-05-09 09:18:47 +00:00
dyoung 6263dee43f Undo last: I committed the wrong file. 2004-05-09 09:00:05 +00:00
dyoung dd998d980d In ieee80211_find_rxnode, when we "fake up" a node for an ad hoc
peer, we have to copy the "master" rate table to the faked-up node's
rate table, or else ath0 will complain, "ath0: bogus xmit rate
0x0".  Thank you Konstantin KABASSANOV for reporting this problem.
2004-05-09 08:19:21 +00:00
dyoung 998a558a7f Following Andrew Brown's suggestion, move net.ieee80211 to
net.link.ieee80211.  The convention is that nodes directly under
net are protocol families (PF_*).

Also, simplify the sysctl setup for net80211 and rssadapt, following
another suggestion by Andrew.
2004-05-06 07:11:40 +00:00
dyoung fcd7df4334 Add a sysctl, net.ieee80211.debug, for turning debug messages on
and off.

Add a sysctl, net.ieee80211.maxinact, for adjusting the node time-out
interval.  After net.ieee80211.maxinact seconds of inactivity, an
AP will purge a peer/client-record.  Now the client has to reassociate.
2004-05-06 03:07:10 +00:00
dyoung 7c84c56e55 Create ieee80211_rssadapt_debug to control rssadapt(9) debug messages
independently from net80211 debug messages.  Create a new sysctl,
net.ieee80211.rssadapt.debug, for turning the debug messages on
and off.

Create a new sysctl, net.ieee80211.rssadapt.expavgctl, to control
the rate of decay for the exponential averages used by rssadapt(9).
2004-05-06 03:03:20 +00:00
dyoung 27d8afead9 No need to suppress if_init calls, ether_ioctl already does it.
Also, ether_ioctl handles more address families than ieee80211_ioctl
was.
2004-05-06 02:58:16 +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 9e76c33909 NetBSD does not contain IPX support. 2004-05-06 02:16:59 +00:00
dyoung 752f5ad0b1 Fix spelling: supress -> suppress. 2004-05-06 02:14:03 +00:00
dyoung 3d73dc9e3e Check if_init error. 2004-05-06 01:56:08 +00:00
cube 57d44e1cee In NetBSD, if_init() expects a struct ifnet, not the softc. 2004-05-05 16:10:29 +00:00
dyoung 6da519f16e Doh. Make it compile w/o IEEE80211_DEBUG. 2004-05-01 01:49:03 +00:00
dyoung 8d4772498f From FreeBSD. Copy the "basic rate" bit from the
ieee80211com to the node's rate set during rate negotiation.  Set
a default .11g protection mode.
2004-04-30 23:58:20 +00:00
dyoung 974bfde812 From FreeBSD. Increase a stats counter when
ieee80211_find_txnode fails.
2004-04-30 23:58:17 +00:00
dyoung bd8379210b From FreeBSD. Handle ad hoc-mode nodes better.
Use FREE/MALLOC instead of free/malloc.  Add back _ieee80211_find_node,
the helper for ieee80211_find_node.
2004-04-30 23:58:14 +00:00
dyoung 26f67ccc94 From FreeBSD. Handle 802.11g protection mode and
Tx power control ioctls.
2004-04-30 23:58:11 +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
dyoung fd6869101d From FreeBSD. Change ieee80211_phymode_name from
a subroutine back to an array.  Rearrange ieee80211_setmode.
Miscellaneous small changes to make our code and FreeBSD's agree.
2004-04-30 23:58:05 +00:00
dyoung bf30017770 From FreeBSD. Definite structures and constants for
QoS/WME/802.11e, for WPA, and for 802.11 MTU.
2004-04-30 23:51:53 +00:00
dyoung ae5c86c258 From FreeBSD. Add protection mode bits. Get rid of
the RCVMGT capability.
2004-04-30 23:51:50 +00:00
dyoung 255f57a8b6 Add a malloc(9) type for 802.11 nodes. 2004-04-30 22:57:32 +00:00
dyoung 40e9f581a4 Add ioctl constants for both the 802.11g protection mode and for
Tx power control.
2004-04-30 22:51:04 +00:00
dyoung 5c35c045ac Sync with FreeBSD. Some apps get confused when the FCS comes at
the end of the tapped frame, so stick it into the radiotap header.
2004-04-30 22:22:53 +00:00
itojun e133d13e80 kill some strcpy 2004-04-21 18:16:14 +00:00
dyoung 811d8c496e Get the sense of ra->ra_nok and ra->ra_nfail right. They indicate
successes and failures, respectively, not the other way around.
2004-03-29 04:09:45 +00:00
dyoung f37c61d56c Add missing flags IEEE80211_CHAN_DYN and IEEE80211_CHAN_GFSK, needed
by userland programs to interpret radiotap channel indications.
2004-03-29 04:08:14 +00:00
dyoung 440b1e7e7f Whitespace nits, esp. change #define<SPACE> to #define<TAB>. 2004-03-29 04:04:48 +00:00
dyoung 73a618d5f3 In wi(4), wi_choose_rate used to contain device-independent code.
I have pulled that code into the function ieee80211_rssadapt_choose
so that I can re-use it in ath(4), atw(4), and in other drivers.

In rssadapt(9), I have also created a struct ieee80211_rssadapt_expavgctl
that contains parameters for rate adaptation. When IEEE80211_RSSADAPT_DEBUG
is enabled, I will using sysctl to expose an ieee80211_rssadapt_expavgctl
for each wireless device.

Also in rssadapt(9), I have introduced an interpolate() macro which
makes the exponential-averaging code more compact.
2004-03-17 17:00:34 +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 61921570d3 Ignore WI_RID_STA_IDENTITY and WI_RID_DBM_ADJUST instead of EINVAL
to allow wiconfig to report other informations.
2004-01-16 14:07:32 +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 1131c0f5f6 Forget the tcpdump $Header$. 2003-12-08 04:48:58 +00:00
dyoung 4232da0fda Diagnostics: complain if packet decapsulation fails. 2003-12-07 05:34:22 +00:00
dyoung 2e4c586701 Oops. Make it compile with 'options IEEE80211_DEBUG'. 2003-12-07 05:29:39 +00:00
dyoung 00c2f586dc Get/set fragmentation threshold. DTRT when the RTS threshold is
set.
2003-12-07 05:23:12 +00:00
dyoung 9270de9dc4 Updates to 802.11 radiotap. The _DB_ flags were used everywhere to
denote a signed dBm Rx power, so rename them to _DBM_ and change
the signedness.  Add new _DB_ flags for unsigned Rx power measured
from an arbitrary reference.

Try to synchronize net80211/ieee80211_radiotap.h with my tcpdump
sources (which public tcpdump has not seen, yet) and with FreeBSD.
2003-12-07 04:49:17 +00:00
dyoung 23d8f48692 Add data-link type DLT_IEEE802_11_RADIO to wi and atw. DLT_IEEE802_11_RADIO
lets you monitor radio stats like received signal strength, which
diversity antenna was used, channel/frequency, modulation, and data
rate.
2003-11-16 09:02:42 +00:00
dyoung 85f84a3155 Cosmetic: get rid of an indent level in ieee80211_find_txnode by
changing an if () ... else to an if () return.
2003-11-02 01:29:05 +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
mycroft c41a3efdb2 Eliminate bogus initializer. 2003-10-27 17:11:19 +00:00
dyoung 9c65c69cd6 Support data-rate adaptation loosely based on the paper "Link
Adaptation Strategy for IEEE 802.11 WLAN via Received Signal Strength
Measurement" by Javier del Prado Pavon and Sunghyun Choi. This
module should provide faster adaptation and higher throughput than
Lucent's rate-adaptation scheme.

Individual drivers need to be modified to use this module. Patches
for wi(4) are forthcoming.
2003-10-26 07:56:41 +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
matt f90b1121c4 bpfattach/bpfdetach need to be protected with NBPFILTER > 0 2003-10-16 22:25:00 +00:00
dyoung db0e43b296 Add WEP shared-key authentication. 2003-10-15 11:43:51 +00:00
itojun 5752b1f9ee add __attribute__((__format__)) to if_printf 2003-10-15 08:13:28 +00:00
dyoung f2a9708c75 Do not index arrays using enum constants, since enums can be
re-ordered and extended. Instead, use a switch-statement or a
key->value table with appropriate bounds-checking.
2003-10-14 23:13:44 +00:00
dyoung 0fc2b8e13f Add missing pktattr declaration. Should compile w/ ALTQ, now. 2003-10-14 23:02:52 +00:00
dyoung 193ac59e63 Fix PR 23146 (sys/net80211/ intergration break WEP/power management
function) from FUKAUMI Naoki.
2003-10-13 20:05:09 +00:00
dyoung 762441ba29 Install header files for the new 802.11 layer. 2003-10-13 04:29:31 +00:00
dyoung 8a3890c655 More changes to the new 802.11 layer:
* Add Kevin Lahey's power-saving support from the old 802.11 layer

* Support for frequency-hopping PHYs

    * Add support frequency-hopping PHY mode, IFM_IEEE80211_FH
    * Add channel flags for frequency-hopping
    * Add mode<->media mappings in for FH PHY in ieee80211_media2rate
      and ieee80211_rate2media

* Stop using IFM_MAKEMODE macro since the mode constants
  (e.g., IFM_IEEE80211_11A) are pre-shifted in sys/net/if_media.h

* Add some PLCP constants.
2003-10-13 04:28:35 +00:00
dyoung 60dad7c3fe * Add support for frequency-hopping PHY mode.
* Do not enable debugging by default w/ IEEE80211_DEBUG.

* Add Kevin Lahey's power-saving support from the old 802.11 layer
2003-10-13 04:27:40 +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 91ca08d44e Add Kevin Lahey's power-saving support from the old 802.11 layer 2003-10-13 04:23:56 +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 730331d557 More changes to the new 802.11 layer:
* Add Kevin Lahey's power-saving support from the old 802.11 layer

* Add my stop-gap rate-selection routine, ieee80211_get_rate,
  from the old 802.11 layer

* Also from the old 802.11 layer: factor ieee80211_match_bss out
  of ieee80211_end_scan, since atw(4) uses it for IBSS merges.
2003-10-13 04:20:23 +00:00
dyoung 56126d8a7e Revive constant IEEE80211_CHAN_ANY for ioctls. 2003-10-13 04:16:59 +00:00
dyoung 6cac03ae0e Adapt ieee80211_ioctl.[ch] to suit NetBSD. NetBSD and FreeBSD have
the least in common here, so I have not concerned myself with
compatibility.
2003-09-28 02:40:14 +00:00