Commit Graph

285 Commits

Author SHA1 Message Date
Adrian Chadd
5bc8125ad3 Break out the debug macros from if_ath.c into if_ath_debug.[ch] .
This is prep work for breaking out the TX path into a separate
set of source files.
2011-01-29 05:08:21 +00:00
Adrian Chadd
a108ab6394 ANI changes #1 - split out the ANI polling from the RxMonitor hook.
The rxmonitor hook is called on each received packet. This can get very,
very busy as the tx/rx/chanbusy registers are thus read each time a packet
is received.

Instead, shuffle out the true per-packet processing which is needed and move
the rest of the ANI processing into a periodic event which runs every 100ms
by default.
2011-01-21 05:21:00 +00:00
Adrian Chadd
88117a532d Include the initial support for external EEPROMs.
The AR9100 at least doesn't have an external serial EEPROM
attached to the MAC; it instead stores the calibration data
in the normal system flash.

I believe earlier parts can do something similar but I haven't
experienced it first-hand.

This commit introduces an eepromdata pointer into the API but
doesn't at all commit to using it. A future commit will
include the glue needed to allow the AR9100 support code
to use this data pointer as the EEPROM.
2011-01-20 07:56:09 +00:00
Adrian Chadd
25c96056ef Use the now-exposed diag code, rather than a hard-coded magic number. 2011-01-20 04:59:11 +00:00
Adrian Chadd
0dbe9289ce Break out the diagnostic codes from ah_internal.h and place them in ah_diagcodes.h.
Since we now have the source code, there's no reason to hide the diag codes
from other areas.

They live in the HAL as they form part of the HAL API and should still be treate
as "potentially flexible; don't publish as a public API." But since they're
already used as a public API (see follow-up commit), we may as well use
them in place of magic constants.
2011-01-20 04:57:26 +00:00
Matthew D Fleming
240577c2a7 Fix up a few more sysctl(9) mis-typing found in various LINT builds. 2011-01-13 18:20:27 +00:00
Matthew D Fleming
6dc7dc9a3e sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly.
Commit the rest of the devices.
2011-01-12 19:53:56 +00:00
Adrian Chadd
e8dabfbea9 Export ath stats via snmp, rather than requiring a debugging interface
and "athstats".
2010-08-14 14:18:02 +00:00
Adrian Chadd
7ec4e6b83b Add a global counter of missed beacons.
The existing missed beacon count is reset once a beacon isn't missed.
2010-08-14 14:01:12 +00:00
Adrian Chadd
8197f57e6a Don't delay updating the longcal timer - instead, update the longcal
flag immediately so it's only set once per longcal interval.

Without this, the current AR5416 code will continuously spam NF
calibrations during a periodic calibration if the longcal flag
is set. The longcal flag wouldn't be cleared until the calibration
method indicates that calibrations are "complete".

This drops the rate of NF calibration updates down from "once every
shortcal" (ie, every 100ms) during a periodic calibration, to only
once per "longcal" interval. Spamming NF calibrations every 100ms
caused some potentially horrific issues in noisy environments as
NF calibrations can take longer than 100ms and this spamming can
cause invalid NF calibration results to be read back - leading to
missed beacons, and thus leading to a stuck beacon situation.

Stuck beacons cause interface resets, which restart calibrations.
This means that the longcal calibration runs every 100ms (shortcal)
until all initial calibrations are completed. This spamming can then
cause the above issues which leads to stuck beacons, leading to
interface resets, etc, etc. Quite annoying.
2010-08-10 07:56:56 +00:00
Adrian Chadd
d273f00076 Extend the ath debugging a little to log the interface name.
Some devices have >1 atheros card and the current debug prints
make it impossible to tell which interface is being unhappy.
2010-07-08 14:08:03 +00:00
Bernhard Schmidt
7041d50cfd sc_lastrs is also used in case the sending station is not known, for
example in a split IBSS scenario. Therefore always assign sc_lastrs.
This removes a hack I committed in r206457.

Approved by:	rpaulo (mentor)
2010-06-14 08:24:00 +00:00
Maxim Sobolev
e50d35e6c6 Add new tunable 'net.link.ifqmaxlen' to set default send interface
queue length. The default value for this parameter is 50, which is
quite low for many of today's uses and the only way to modify this
parameter right now is to edit if_var.h file. Also add read-only
sysctl with the same name, so that it's possible to retrieve the
current value.

MFC after:	1 month
2010-05-03 07:32:50 +00:00
Bernhard Schmidt
632ee7e3a4 Add WPA-None support:
* WPA-None requires ap_scan=2:
  The major difference between ap_scan=1 (default) and 2 is, that no
  IEEE80211_IOC_SCAN* ioctls/functions are called, though, there is a
  dependency on those. For example the call to wpa_driver_bsd_scan()
  sets the interface UP, this never happens, therefore the interface
  must be marked up in wpa_driver_bsd_associate(). IEEE80211_IOC_SSID
  also is not called, which means that the SSID has not been set prior
  to the IEEE80211_MLME_ASSOC call.
* WPA-None has no support for sequence number updates, it doesn't make
  sense to check for replay violations..
* I had some crashes right after the switch to RUN state, issue is
  that sc->sc_lastrs was not yet defined.

Approved by:	rpaulo (mentor)
MFC after:	3 weeks
2010-04-10 13:54:00 +00:00
Daniel Eischen
4fa8d4eff4 Correct spelling of reseting (found while researching the "bb hang detected"
messages that are plaguing me).  While I'm here, delete trailing whitespace.
2010-02-19 18:23:45 +00:00
Rui Paulo
1ac5dac214 Fix typo in comment.
Pointed out by:	danfe
2010-02-10 11:12:39 +00:00
Tai-hwa Liang
4a97e4f030 Fixing compilation bustage by removing a stray comment fragment. 2010-02-09 04:07:39 +00:00
Rui Paulo
9ac01d39ad Add multicast key search support. This fixes corrupted mcast packets
when we have more than one hostap vap.

Submitted by:	Russell Yount <russell.yount at gmail.com>
MFC after:	2 weeks
2010-02-08 20:23:20 +00:00
Gavin Atkinson
7964930201 Spell "Hz" correctly wherever it is user-visible.
PR:		bin/142566
Submitted by:	N.J. Mann   njm njm.me.uk
Approved by:	ed (mentor)
MFC after:	2 weeks
2010-01-12 17:59:58 +00:00
Warner Losh
f29b8b7f41 cardbus -> CardBus 2010-01-03 23:31:58 +00:00
John Baldwin
e1b17582f4 Take a step towards removing if_watchdog/if_timer. Don't explicitly set
if_watchdog/if_timer to NULL/0 when initializing an ifnet.  if_alloc()
sets those members to NULL/0 already.
2009-11-06 14:55:01 +00:00
Sam Leffler
518de5f837 correct typo that was a noop on 32-bit machines but a bug on 64-bit machines
Submitted by:	phk
2009-09-07 16:08:21 +00:00
Sam Leffler
394f34a579 On resume in sta mode program the beacon timers so when roaming (and
the previous ap is no longer in range) the device will deliver bmiss
interrupts and trigger the state machine.  Also arrange to sync the
beacon timers on the next received beacon frame so that when we don't
roam we re-synchronize with the ap.

Tested by:	trasz
MFC after:	1 week
2009-08-31 21:25:49 +00:00
Sam Leffler
fe0dd78965 track whether any mesh vaps are present to correctly setup the rx filter
when, for example, an ap vap is created first

Reviewed by:	rpaulo
Approved by:	re (kib)
2009-07-21 19:01:04 +00:00
Rui Paulo
7d26189145 Fix something bogus deletion that got it during mesh commit.
Approved by:	re (implicit)
2009-07-11 16:02:06 +00:00
Rui Paulo
59aa14a91d Implementation of the upcoming Wireless Mesh standard, 802.11s, on the
net80211 wireless stack. This work is based on the March 2009 D3.0 draft
standard. This standard is expected to become final next year.
This includes two main net80211 modules, ieee80211_mesh.c
which deals with peer link management, link metric calculation,
routing table control and mesh configuration and ieee80211_hwmp.c
which deals with the actually routing process on the mesh network.
HWMP is the mandatory routing protocol on by the mesh standard, but
others, such as RA-OLSR, can be implemented.

Authentication and encryption are not implemented.

There are several scripts under tools/tools/net80211/scripts that can be
used to test different mesh network topologies and they also teach you
how to setup a mesh vap (for the impatient: ifconfig wlan0 create
wlandev ... wlanmode mesh).

A new build option is available: IEEE80211_SUPPORT_MESH and it's enabled
by default on GENERIC kernels for i386, amd64, sparc64 and pc98.

Drivers that support mesh networks right now are: ath, ral and mwl.

More information at: http://wiki.freebsd.org/WifiMesh

Please note that this work is experimental. Also, please note that
bridging a mesh vap with another network interface is not yet supported.

Many thanks to the FreeBSD Foundation for sponsoring this project and to
Sam Leffler for his support.
Also, I would like to thank Gateworks Corporation for sending me a
Cambria board which was used during the development of this project.

Reviewed by:	sam
Approved by:	re (kensmith)
Obtained from:	projects/mesh11s
2009-07-11 15:02:45 +00:00
Robert Watson
eb956cd041 Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/
IF_ADDR_UNLOCK() across network device drivers when accessing the
per-interface multicast address list, if_multiaddrs.  This will
allow us to change the locking strategy without affecting our driver
programming interface or binary interface.

For two wireless drivers, remove unnecessary locking, since they
don't actually access the multicast address list.

Approved by:	re (kib)
MFC after:	6 weeks
2009-06-26 11:45:06 +00:00
Sam Leffler
f6cbf16a0f purge HAL_TXSTAT_ALTRATE; you can figure this out by checking ts_finaltsi
and it cannot be used with MCS rate codes
2009-06-13 23:36:54 +00:00
Sam Leffler
309a3e4521 treat IEEE80211_S_CSA as a "running state"; this fixes
ap mode 11h channel switch announcements
2009-06-03 17:25:19 +00:00
Sam Leffler
3050678410 improve raw xmit failure handling 2009-06-02 21:17:56 +00:00
Sam Leffler
9cb930760c count frag tx failures as an ifnet error 2009-06-02 21:13:57 +00:00
Sam Leffler
09be6601b5 fix comment 2009-06-02 21:12:07 +00:00
Sam Leffler
c89b957a1c restart tdma beacons after vap destroy 2009-06-02 21:11:26 +00:00
Sam Leffler
5463c4a485 Overhaul monitor mode handling:
o replace DLT_IEEE802_11 support in net80211 with DLT_IEEE802_11_RADIO
  and remove explicit bpf support from wireless drivers; drivers now
  use ieee80211_radiotap_attach to setup shared data structures that
  hold the radiotap header for each packet tx/rx
o remove rx timestamp from the rx path; it was used only by the tdma support
  for debugging and was mostly useless due to it being 32-bits and mostly
  unavailable
o track DLT_IEEE80211_RADIO bpf attachments and maintain per-vap and
  per-com state when there are active taps
o track the number of monitor mode vaps
o use bpf tap and monitor mode vap state to decide when to collect radiotap
  state and dispatch frames; drivers no longer explicitly directly check
  bpf state or use bpf calls to tap frames
o handle radiotap state updates on channel change in net80211; drivers
  should not do this (unless they bypass net80211 which is almost always
  a mistake)
o update various drivers to be more consistent/correct in handling radiotap
o update ral to include TSF in radiotap'd frames
o add promisc mode callback to wi

Reviewed by:	cbzimmer, rpaulo, thompsa
2009-05-20 20:00:40 +00:00
Sam Leffler
ab06fdf2a5 optimize ath_tx_findrix: there's no need to walk the rates table as
sc_rixmap is an inverse map

NB: could eliminate the check for an invalid rate by filling in 0 for
    invalid entries but the rate control modules use it to identify
    bogus rates so leave it for now
2009-05-07 00:35:32 +00:00
Sam Leffler
a8962181ad o cleanup checks for which vap combinations are permitted and what to
use for ic_opmode
o fixes the case where creating ahdemo+wds vaps caused ic_opmode to be
  set to hostap
2009-05-06 23:49:55 +00:00
Sam Leffler
04f19fd699 make superg/fast-frames state dynamically-allocated (and indirect off
the com structure instead of embedded); this reduces the overhead when
not configured and reduces visibility of the contents
2009-05-02 20:16:55 +00:00
Sam Leffler
e40b6ab1cf don't use caddr_t to match ieee80211_dump_pkt type; supplying the correct
one costs nothing
2009-04-13 20:58:47 +00:00
Sam Leffler
040972a18b o fix dynamic slave-side tdma slot length updating: we need to re-setup the
burst length in the tx q's
o remove re-config of the beaconq on update; it's not needed
2009-04-13 20:57:34 +00:00
Sam Leffler
89047529ac remove reference to sc_tdmabintcnt; it was removed in r190848 2009-04-13 03:20:21 +00:00
Sam Leffler
339ccfb391 Hoist 802.11 encapsulation up into net80211:
o call ieee80211_encap in ieee80211_start so frames passed down to drivers
  are already encapsulated
o remove ieee80211_encap calls in drivers
o fixup wi so it recreates the 802.3 head it requires from the 802.11
  header contents
o move fast-frame aggregation from ath to net80211 (conditional on
  IEEE80211_SUPPORT_SUPERG):
  - aggregation is now done in ieee80211_start; it is enabled when the
    packets/sec exceeds ieee80211_ffppsmin (net.wlan.ffppsmin) and frames
    are held on a staging queue according to ieee80211_ffagemax
    (net.wlan.ffagemax) to wait for a frame to combine with
  - drivers must call back to age/flush the staging queue (ath does this
    on tx done, at swba, and on rx according to the state of the tx queues
    and/or the contents of the staging queue)
  - remove fast-frame-related data structures from ath
  - add ieee80211_ff_node_init and ieee80211_ff_node_cleanup to handle
    per-node fast-frames state (we reuse 11n tx ampdu state)
o change ieee80211_encap calling convention to include an explicit vap
  so frames coming through a WDS vap are recognized w/o setting M_WDS

With these changes any device able to tx/rx 3Kbyte+ frames can use fast-frames.

Reviewed by:	thompsa, rpaulo, avatar, imp, sephe
2009-03-30 21:53:27 +00:00
Sam Leffler
584f7327f1 Remove ATH_SUPPORT_TDMA and use IEEE80211_SUPPORT_TDMA instead. It
doesn't make much sense to configure driver support w/o net80211.
Note this means ath now depends on opt_wlan.h.
2009-03-30 19:23:49 +00:00
Sam Leffler
29aca94080 Eliminate ic_myaddr so changing the mac address of a device works correctly:
o remove ic_myaddr from ieee80211com
o change ieee80211_ifattach to take the mac address of the physical device
  and use that to setup the lladdr.
o replace all references to ic_myaddr in drivers by IF_LLADDR
o related cleanups (e.g. kill dead code)

PR:		kern/133178
Reviewed by:	thompsa, rpaulo
2009-03-29 17:59:14 +00:00
Sam Leffler
c4d3fad2ec purge hal abi support; now that the hal is merged w/ the driver
we cannot be out of sync

MFC after:	1 week
2009-03-19 19:29:10 +00:00
Sam Leffler
2bc3ce7732 Minor cleanups of tdma protocol handling:
o break out version-related code to simplify rev'ing the protocol
o add parameter validation macros so checks that appear multiple places
  are consistent (and easy to change)
o add protocol version check when looking for a scan candidate
o improve scan debug output format
o rewrite beacon update handling to calculate a bitmask of changed values
  and pass that down through the driver callback so drivers can optimize work
o do slot bounds check before use when parsing received beacons
2009-03-18 19:28:17 +00:00
Sam Leffler
2e986da5f1 replace if_watchdog w/ private callout; probably can merge this with the
calibration work sometime in the future
2009-03-09 23:10:19 +00:00
Sam Leffler
9c859a041a add a sysctl to ena/dis frobbing cca 2009-03-05 00:15:43 +00:00
Sam Leffler
869ff02ebe 5416 and later parts mux the gpio outputs; extend the api to include
a signal type that's used to select the appropriate mux
2009-02-24 00:12:16 +00:00
Sam Leffler
498657cff2 print mac+rf part names; drop the printing 2ghz rf stuff (might come back) 2009-02-23 23:41:12 +00:00
Sam Leffler
d497b6a449 remove private support for IEEE80211_MODE_HALF and IEEE80211_MODE_QUARTER
now that net80211 has them
2009-02-19 05:22:40 +00:00