Commit Graph

498 Commits

Author SHA1 Message Date
Sam Leffler
c3f10abd7e When crafting a media setting w/ an auto (non-fixed) rate mask out the
turbo option in addition to the mode bits; otherwise if the current
channel is a turbo mode channel we'll form an invalid media setting
and the ifmedia_set operation in vap_attach will panic.

While here use C99-style initialization for an array indexed by mode;
this makes it consistent w/ other usage and avoids breakage if we
should ever change the set of modes.
2009-02-03 22:32:26 +00:00
Sam Leffler
a3dfb736e8 when promoting an 11b channel to 11g do not accept a ``pure G'' (OFDM only)
channel, only accept a real 11g channel; this fixes a problem where we were
wrongly promoting 11b to a Dynamic Turbo G channel which broke scanning on
channel 6
2009-02-01 22:24:08 +00:00
Sam Leffler
800e5ab76a setup default fixed rates for static turbo and 11n;
the 11n rates are pure guess
2009-01-29 23:12:06 +00:00
Sam Leffler
f76cde9515 set ni_txparms for static turbo mode 2009-01-29 23:11:18 +00:00
Sam Leffler
8500d65d94 setup default rate set for static turbo mode 2009-01-29 23:09:12 +00:00
Sam Leffler
f8b1ea1737 add an assert to verify the number of channels returned by ic_getradiocaps
correlates with the size of the channel array passed down

might want to promote this to be always present to catch for driver errors
2009-01-28 18:39:23 +00:00
Sam Leffler
a6f34da70b change null_getradiocaps to return the actual count of channels instead
of the true number; otherwise the caller may use the count to do things
with the data it should not (e.g. sort the channel table)
2009-01-28 18:37:46 +00:00
Sam Leffler
00a7aacaa7 Extend channel definition with:
o max antenna gain
o driver private opaque data

Note this grows the size of a channel to 16 bytes; which makes the
default channel table 4Kbytes (up from 3Kbytes).
2009-01-27 23:48:13 +00:00
Sam Leffler
b83f2cf386 fix comment 2009-01-27 23:43:20 +00:00
Sam Leffler
8658b18b82 Remove assumptions about the max # channels in ioctl's:
o change ioctl's that pass channel lists in/out to handle variable-size
  arrays instead of a fixed (compile-time) value; we do this in a way
  that maintains binary compatibility
o change ifconfig so all channel list data structures are now allocated
  to hold MAXCHAN entries (1536); this, for example, allows the kernel
  to return > IEEE80211_CHAN_MAX entries for calls like IEEE80211_IOC_DEVCAPS
2009-01-27 23:42:14 +00:00
Sam Leffler
5fe9f04492 change ic_getradiocaps driver callback to include the max # channels
so callers know the size of the array passed down
2009-01-27 23:19:36 +00:00
Sam Leffler
84e7c58867 o add country codes from Atheros regulatory; these are not listed in
the ISO tables, mark them accordingly
o add sku's for handling 900MHz cards
o add opaque struct defs and change []'s to *'s so this file can be
  included w/o requiring all of net80211 to be pulled in
o make CTRY_DEBUG and CTRY_DEFAULT public
2009-01-27 23:09:55 +00:00
Sam Leffler
3d13a95516 o make %b msg bit defines public (to user apps too)
o rename IEEE80211_C_CRYPTO_BITS to IEEE80211_CRYPTO_BITS
2009-01-27 23:00:38 +00:00
Sam Leffler
9c2c544d8d fill in ieee channel #'s and max tx power for drivers that work exclusively
with frequencies; this mimics how ieee80211_setregdomain works
2009-01-27 22:48:46 +00:00
Sam Leffler
998c561f7b add new state bit to indicate when interference is observed on the channel 2009-01-27 22:46:34 +00:00
Sam Leffler
f3ab1589e8 change IEEE80211_IS_CHAN_OFDM and IEEE80211_IS_CHAN_CCK to return true
for 11g (dynamic CCK/OFDM)
2009-01-27 22:45:31 +00:00
Sam Leffler
8fed2e0450 define IEEE80211_CHAN_108A and IEEE80211_CHAN_108G in terms of their
non-turbo names to make the relationship more clear
2009-01-27 22:43:32 +00:00
Andrew Thompson
8d9b29f35b If the parent up/down task was queued then sync with it before returning from
the vap ioctl. This means that the parent interface should hopefully be up
before we return to userland, it does not depend on the parent init succeeding,
just that it was run.

This fixes wpa_supplicant with ndis and USB where the parent interfaces can be
slow to init.
2009-01-25 07:31:51 +00:00
Sam Leffler
a5985e8b56 fix regulatory state check for all vaps' being down; it must be done
before calling the ic_setregdomain callback
2009-01-23 18:16:14 +00:00
Sam Leffler
76df237570 add defines for driver-private bits to eliminate use of constants 2009-01-23 18:15:09 +00:00
Sam Leffler
8d092df91a add missing return that broke WPA1+2 support
Submitted by:	"Jared Go" <jared@hobnob.com>
2009-01-11 18:59:14 +00:00
Sam Leffler
10ad9a77f3 TDMA support for long distance point-to-point links using ath devices:
o add net80211 support for a tdma vap that is built on top of the
  existing adhoc-demo support
o add tdma scheduling of frame transmission to the ath driver; it's
  conceivable other devices might be capable of this too in which case
  they can make use of the 802.11 protocol additions etc.
o add minor bits to user tools that need to know: ifconfig to setup and
  configure, new statistics in athstats, and new debug mask bits

While the architecture can support >2 slots in a TDMA BSS the current
design is intended (and tested) for only 2 slots.

Sponsored by:	Intel
2009-01-08 17:12:47 +00:00
Sam Leffler
6ca74c40de only mark an infrastructure node to require an associd for xmit; fixes adhoc
mode sta's that join an existing ibss
2009-01-07 18:17:36 +00:00
Sam Leffler
9094ffdfe3 mark discovered neighbors QoS capable if they advertise wme 2008-12-31 21:29:09 +00:00
Sam Leffler
72fecb4d6c follow prevailing style 2008-12-31 21:21:46 +00:00
Sam Leffler
e2126dec84 convert MALLOC/FREE to malloc/free 2008-12-18 23:00:09 +00:00
Sam Leffler
12c290fe6e fix comment
Submitted by:	Daan Vreeken
2008-12-16 01:17:36 +00:00
Sam Leffler
ca92652af7 Fix ucastkey teardown for drivers that plumb clear keys or similar
(e.g. ath): we must check the key index and not whether the key
points at a cipher other than "undef".  This looks like it's been
broken for a while.  Might be worth adding an explicit clear cipher
at some point though this would require changes to the usage of
IEEE80211_KEY_UNDEFINED.

PR:		125906
2008-12-15 22:50:50 +00:00
Sam Leffler
7946271527 remove extraneous ';' 2008-12-15 22:31:54 +00:00
Sam Leffler
31378b1c87 Fix definition of IEEE80211_CHAN_MAX; it was defined as 255 but
really was meant to be 256.  Adjust usage accordingly and replace
bogus usage of this value in checking IEEE channel #'s.

NB: this causes an ABI change; ifconfig must be recompiled
2008-12-15 01:26:33 +00:00
Sam Leffler
1b999d643c Replace adhoc checks in ieee80211_start with a per-node flag that
indicates if an association id is required before outbound traffic
is permitted.  This cleans up the previous change that broke mcast
traffic "to the stack" in ap mode as a side effect.

Reviewed by:	sephe, thompsa, weongyo
2008-12-15 00:47:24 +00:00
Bjoern A. Zeeb
4b79449e2f Rather than using hidden includes (with cicular dependencies),
directly include only the header files needed. This reduces the
unneeded spamming of various headers into lots of files.

For now, this leaves us with very few modules including vnet.h
and thus needing to depend on opt_route.h.

Reviewed by:	brooks, gnn, des, zec, imp
Sponsored by:	The FreeBSD Foundation
2008-12-02 21:37:28 +00:00
Sam Leffler
f7eb979a5e correct sorting 2008-11-23 01:51:14 +00:00
Kip Macy
aea78d2094 convert calls to IFQ_HANDOFF to if_transmit 2008-11-22 07:35:45 +00:00
Sam Leffler
d6f57961a8 Fix checks for fast frames negotiation. ni_ath_flags holds the
capabilities reported by the ap.  These need to be cross-checked
against the local configuration in the vap.  Previously we were
only checking the ap capabilities which meant that if an ap reported
it was ff-capable but we were not setup to use them we'd try to do
ff aggregation and drop the frame.

There are a number of problems to be fixed here but applying this
fix immediately as the problem causes all traffic to stop (and has
not workaround).

Reported by:	Ashish Shukla
2008-10-30 16:22:04 +00:00
Sam Leffler
e66b0905fc o use the new association callback to notify the driver when joining a bss
in sta and adhoc modes; this should've been done forever ago as most all
  drivers use this hook to set per-station transmit parameters such as for
  tx rate control
o adjust drivers to remove explicit calls to the driver newassoc method
2008-10-27 16:46:50 +00:00
Sam Leffler
5d44f8c024 o re-enable a lock assert
o while here reformat a comment to sync w/ other repot's
2008-10-26 21:59:07 +00:00
Sam Leffler
8f4addc0a8 Fix joining an 11b BSS: scanning is normally done using 11g channels
(unless explicitly locked to mode 11b) so when we join the bss the
channel attached to the scan cache entry may need to be demoted.

o demote to 11b if the ap is advertising 11b rates
o skip the ap if it's 11b but we're locked to 11g (could consider this
  advisory but for now treat it as mandatory)
o handle an odd edge case, if there is a fixed transmit rate for 11g
  then the rate check against the 11b ap will fail, try to demote to
  11b and retry the rate check

Reviewed by:	sephe, thompsa
2008-10-26 21:56:27 +00:00
Sam Leffler
63092fce49 New ap-side power save implementation; the main change is to allow drivers
to queue frames previously encapsulated on a separate high priority list
that is dispatched before the unencapsulated frames (to preserve order).
2008-10-26 01:04:46 +00:00
Sam Leffler
99f1b25c9f move decl up before first use 2008-10-26 01:01:01 +00:00
Sam Leffler
c1af44bdac introduce M_ENCAP flag to mark packets encapsulated w/ an 802.11 header 2008-10-26 00:55:38 +00:00
Sam Leffler
0e66722d20 fix comment that belonged w/ previous commit 2008-10-26 00:52:26 +00:00
Sam Leffler
16d7cbb108 change ieee80211_send_probereq to supply raw xmit parameters so it can
control how frames are handled by the driver
2008-10-26 00:48:20 +00:00
Sam Leffler
6683931e81 change ieee80211_send_nulldata to send a QoS Null Data frame to a
QoS-enabled station; this makes inactivity handling follow the spec
as previously it would probe inactive stations w/ a Null Data (no QoS)
data frame
2008-10-26 00:46:17 +00:00
Sam Leffler
8ac160cd2e o change ieee80211_mgmt_output to take a raw xmit parameters block so
the net80211 layer has complete control over the handling of mgt frames
  (in particular, the ac, tx rate, and retry count); this also allows us
  to purge the M_LINK0 flag that was attached to mbufs to mark them as
  needing encryption for shared key auth
o change ieee80211_send_setup to take a tid parameter so it can be used
  to setup QoS frames
2008-10-26 00:43:11 +00:00
Sam Leffler
380b865a0d fix old merge botch that causes gaps in the tx seq# space for QoS frames 2008-10-26 00:32:02 +00:00
Sam Leffler
cc71a422ea Sync BAR frame handling with out of tree work:
o correct BAR frame construction for AMPDU
o retransmit BAR frames until ACK'd or timeout (use tunables to
  control behaviour, default is very aggressive)
o defer seq# update until BAR frame is ACK'd
o add BAR response handling callback for driver to interpose and
  push new state to device or push pending aggregates

While here also:
o add backpointer to node in the per-tid tx aggregation data structure
o move ampdu tx state setup/teardown work to separate functions
2008-10-25 23:58:59 +00:00
Sam Leffler
dfcd1f4d0e set erp flag and tx parameter state when joining a bss; this allows
drivers to use ni_txparms
2008-10-25 23:44:25 +00:00
Sam Leffler
ae3f00bbfd honor IEEE80211_CLONE_NOBEACONS for type of vap, not just a sta mode vap 2008-10-25 23:43:08 +00:00
Sam Leffler
be1054ed14 improve inactivity handling debug support 2008-10-25 23:40:48 +00:00