Commit Graph

86145 Commits

Author SHA1 Message Date
adrian
baf1247717 Major fix: when doing open-loop TX power calibration, adjust
the correct CCK rates rather than adjusting the first handful.
This may have affected some AR9280 based NICs.

Minor fix: merlin check update
2011-05-14 04:17:16 +00:00
adrian
000c7ea1de Fixes from the Atheros HAL - formatting; update Merlin checks to be consistent.
Nothing functional should change with this commit.
2011-05-14 04:05:23 +00:00
attilio
75eec16b78 Remove actual files supporting sun4v.
Approved by:	re
2011-05-14 01:56:48 +00:00
attilio
96139278ce Disconnect sun4v architecture from the three.
Some files keep the SUN4V tags as a code reference, for the future,
if any rewamped sun4v support wants to be added again.

Reviewed by:	marius
Tested by:	sbruno
Approved by:	re
2011-05-14 01:53:38 +00:00
adrian
882abde07a Even though initial calibrations aren't done (yet), add this so we're
consistent with the Atheros HAL.
2011-05-14 01:41:36 +00:00
jhb
730731c714 Merge comments about converting directory entries to be more direct and
concise.

Inspired by:	Gleb Kurtsou
2011-05-14 01:10:57 +00:00
stas
218a490daf - Bump __FreeBSD_version to note the revision when libprocstat(3) and fuser(1)
have been added to the tree.
2011-05-13 23:10:55 +00:00
mdf
3d3b036f95 Move the ZERO_REGION_SIZE to a machine-dependent file, as on many
architectures (i386, for example) the virtual memory space may be
constrained enough that 2MB is a large chunk.  Use 64K for arches
other than amd64 and ia64, with special handling for sparc64 due to
differing hardware.

Also commit the comment changes to kmem_init_zero_region() that I
missed due to not saving the file.  (Darn the unfamiliar development
environment).

Arch maintainers, please feel free to adjust ZERO_REGION_SIZE as you
see fit.

Requested by:	alc
MFC after:	1 week
MFC with:	r221853
2011-05-13 19:35:01 +00:00
mdf
9465c34001 Usa a globally visible region of zeros for both /dev/zero and the md
device.  There are likely other kernel uses of "blob of zeros" than can
be converted.

Reviewed by:	alc
MFC after:	1 week
2011-05-13 18:48:00 +00:00
cognet
68e2172c9a In pmap_change_wiring(), use the right argument for pmap_modify_pv().
It only worked because the only consumer calls pmap_change_wiring() to remove
the wiring.
2011-05-13 15:54:12 +00:00
mdf
5e42f0aa77 Note that the _SWAP operation is supported for all list/queue types.
Also place STAILQ_REMOVE_HEAD in alphabetical order.  Lastly, document
the _SWAP macros.

PR:		kern/143033
MFC after:	1 week
2011-05-13 15:49:23 +00:00
brix
5832fad208 Allow direct children of PCI-ISA bridges to allocate resources from
the parent PCI bus.

Heavily inspired by jhb@ and a similar implementation present in
sys/dev/pci/vga_pci.c.

Reviewed by:	jhb
Approved by:	jhb
2011-05-13 15:06:35 +00:00
adrian
fdf2456eee Only do open loop power control and temperature compensation
for the AR9280 based NICs if it's actually enabled.

Some of the OLC code was erroneously called during setup
and calibration. This may have caused some incorrect behaviour.
2011-05-13 14:33:45 +00:00
mdf
5ffb572962 Correctly use INOUT for the offset/len parameters to vop_allocate. As
far as I can tell this is for documentation only at the moment.
2011-05-13 14:29:28 +00:00
mav
1881f29e6e Refactor Xen PV code to use new event timers subsystem. That uses one-shot
Xen timer and time counter to provide one-shot and periodic time events.

On my tests this reduces idle interruts rate down to about 30Hz, and accor-
ding to Xen VM Manager reduces host CPU load by three times comparing to
the previous periodic 100Hz clock. Also now, when needed, it is possible to
increase HZ rate without useless CPU burning during idle periods.

Now only ia64 and some ARMs left not migrated to the new event timers.
2011-05-13 12:39:37 +00:00
adrian
78eaf5d431 Remove duplicate code - add a function which calculates the ratesArray[]
table which contains the per-rate target TX power.

This code is shared between the v14 eeprom board setup (AR5416, AR9160,
AR9280) and will also be used by the upcoming Kite (AR9287) support.
2011-05-13 10:36:38 +00:00
adrian
0541c8dd0d Some diversity changes relating to AR9285.
* grab the main, alt and selected LNA config
* add some optional / disabled logging code
* add a check to reject packets with an invalid main rssi too,
  in case the alt is the active receive chain and main is -ve.

Note: The software-controlled combined diversity code is still disabled.
2011-05-13 09:57:12 +00:00
mdf
bbbc4c5455 Use a name instead of a magic number for kern_yield(9) when the priority
should not change.  Fetch the td_user_pri under the thread lock.  This
is probably not necessary but a magic number also seems preferable to
knowing the implementation details here.

Requested by:	Jason Behmer < jason DOT behmer AT isilon DOT com >
2011-05-13 05:27:58 +00:00
mav
224bed0ec4 Fix msleep() usage in Xen balloon driver to not wake up on every HZ tick. 2011-05-13 03:40:16 +00:00
davidch
4edd1b3cb1 - Use bus_describe_intr() to describe interrupt usage.
- Use bus_bind_intr() to bind interrupt to a CPU when RSS/TSS is used.
- Use M_DONTWAIT for RSS/TSS buffer allocation.
- Add statistic to track max DRBR queue depth.
- Fix problem in bxe_change_mtu() which referenced the old MTU size
  in a debug print statement.

MFC after:	Two weeks
2011-05-12 23:26:53 +00:00
yongari
a1c70169d3 Add initial BCM5719 support. TSO and jumbo frame was intentionally
disabled for BCM5719 A0 revision due to known hardware errata.
Many thanks to Broadcom for continuing support of FreeBSD.

Submitted by:	Geans Pin at Broadcom
2011-05-12 17:15:57 +00:00
yongari
4f778730ab Explicitly clear 1000baseT control register for F1 PHY used in
AR8132 FastEthernet controller. The PHY has no ability to
establish a gigabit link. Previously only link parters which
support down-shifting was able to establish link.
This change should fix a long standing link establishment issue of
AR8132.

PR:		kern/156935
MFC after:	1 week
2011-05-12 17:11:31 +00:00
nwhitehorn
f9ee184b6e Remove some hacks to handle strange behavior of LXT 970 PHYs now better
handled in miibus after r221812. Thanks to marius@ for piecing this
together!
2011-05-12 14:27:28 +00:00
marius
c7f911d054 Some PHYs like the Level One LXT970 optionally can default to isolation
after rest, in which case we may need to deisolate it.
Tested by:	nwhitehorn

MFC after	1 week
2011-05-12 14:16:07 +00:00
adrian
2572f17fb8 Now that the devices with functioning ps-poll hardware support have
been enumerated (merlin and later), flick this on.
2011-05-12 14:03:29 +00:00
avg
aed257e3d8 fix build on 32-bit platforms for r221803
Casting a pointer to a wide integer is probably not that bad, but I am
still guilty of not testing this.

Pointyhat to:	avg
MFC after:	1 week
X-MFC with:	r221803
2011-05-12 12:18:01 +00:00
stas
fc10099a3d - Do no try to drop a NULL filedesc pointer. 2011-05-12 10:56:33 +00:00
stas
5f9f795476 - Commit work from libprocstat project. These patches add support for runtime
file and processes information retrieval from the running kernel via sysctl
  in the form of new library, libprocstat.  The library also supports KVM backend
  for analyzing memory crash dumps.  Both procstat(1) and fstat(1) utilities have
  been modified to take advantage of the library (as the bonus point the fstat(1)
  utility no longer need superuser privileges to operate), and the procstat(1)
  utility is now able to display information from memory dumps as well.

  The newly introduced fuser(1) utility also uses this library and able to operate
  via sysctl and kvm backends.

  The library is by no means complete (e.g. KVM backend is missing vnode name
  resolution routines, and there're no manpages for the library itself) so I
  plan to improve it further.  I'm commiting it so it will get wider exposure
  and review.

  We won't be able to MFC this work as it relies on changes in HEAD, which
  was introduced some time ago, that break kernel ABI.  OTOH we may be able
  to merge the library with KVM backend if we really need it there.

Discussed with:	rwatson
2011-05-12 10:11:39 +00:00
adrian
f47d00001a Break out the AR9285 analog registers from ar5416/ar5416phy.h and put
them in a new header file, ar9002/ar9285_an.h.

Shuffle the AR9280 analog registers in ar5416/ar541phy.h into a contiguous
spot.
2011-05-12 10:11:24 +00:00
avg
4e7ece616d dsp/pcm: allow to mmap both read and write buffers using the same fd
This brings our implementation in line with OSS specification for
systems that support mmap.  The change should also improve compatibility
with OSS software not specifically written for FreeBSD, e.g. PulseAudio
OSS plugin.

Reviewed by:	kib, jhb
MFC after:	1 week
2011-05-12 07:44:41 +00:00
adrian
3fe0beec0e Fix the half/quater rate PLL setup for AR5416, AR9160 and
(beta?) AR9280 chips.

Note: This doesn't "fix" half/quarter rate support for these
chips; it merely fixes an oversight.

Obtained from:	Atheros
2011-05-12 03:25:24 +00:00
adrian
ed33f6206b Fixes from Atheros:
* If AR9130, give the chip extra time to reset
* If AR5416, don't shutdown the chip during reset
2011-05-12 03:15:21 +00:00
jfv
f716e166a2 Correct a typo 2011-05-12 00:10:29 +00:00
thompsa
34effb6be7 Move the three geom kprocs as threads under a single pid.
Reviewed by:	julian
2011-05-11 21:47:30 +00:00
jfv
3cb21d8ed2 Chipset support for the new Intel Panther Point PCH, thanks
to Seth Heasley for preparing the changes.
2011-05-11 20:31:27 +00:00
ae
d529455d7d Add basic metadata integrity check. In case when partition table was
probed and read successfull, but it contains invalid values (e.g.
overlapped partitions, offset or size is out of bounds), then table
will be rejected.

MFC after:	1 month
2011-05-11 19:59:43 +00:00
dchagin
e506954648 Remove wrong comment.
MFC after:	1 week.
2011-05-11 17:57:15 +00:00
adrian
0755b8e882 Fix up the net80211 alq logging - this commit makes it usable.
* revert a local path change that shouldn't have made it to the commit
* fix some indenting/wrapping

* Fix the ale data copy - i should be copying into the ale data pointer,
  not over the ale entry itself.
2011-05-11 17:20:35 +00:00
adrian
3e01906b9d net80211 alq bugfixes:
* Track number of logged operations
* call alq_post() so things are logged
* network order things
2011-05-11 16:44:19 +00:00
adrian
51b81d320e Make the NF calibration logic (hopefully!) more resistive to noisy
environments.

In setups where NF calibration can take a while, don't load the CCA
and kick off a new NF calibration if the previous one hasn't yet
completed. This shouldn't happen unless the environment is noisy but
those exist (hi phk!).

Here, if the previous NF hasn't completed when ar5416LoadNf() is run
(which reads the NF), it skips updating the history buffer, loading
the NF CCA array and kicking off the next NF cal. It's hoped it'll
occur in the next long calibration interval.

Obtained from:	Atheros, ath9k, my local HAL
2011-05-11 13:40:13 +00:00
adrian
83c864fab3 Always log if the NF CCA load fails; so users with debugging enabled
can see they're likely in a very noisy environment.
2011-05-11 13:25:43 +00:00
adrian
c7c34734f4 Make sure the chip is awake before writing to it to finally detach
it.

Obtained from:	Atheros
2011-05-11 13:24:17 +00:00
adrian
b410b114e0 Add a new flag - HAL_DEBUG_UNMASKABLE - which always logs a debug message
(when debug is enabled) no matter what.
2011-05-11 13:22:41 +00:00
adrian
1f0e7d70a6 Remove unused variable 2011-05-11 13:20:25 +00:00
adrian
73e0979e8a Remove the initial NF completion check.
This is taking quite a while for some people in some situations
(eg AR5418 in phk's Abusive Radio Environment).

Instead, the rest of the calibration related code should
ensure that a NF calibration has occured before reading NF
values and kicking off another NF calibration.

The channel should also likely be marked as "noisy" (CWINT)
if the NF calibration takes too long.
2011-05-11 11:02:20 +00:00
adrian
04842bd6c0 Remove a now unneeded comment.. 2011-05-11 10:30:31 +00:00
adrian
24eff2bd45 Restore the RSSI threshold after writing the board values.
This would be overwritten by the board initvals written in ah->writeIni().
2011-05-11 09:47:48 +00:00
gonzo
8fa1543414 Use new option names for NFS client and NFS server
See UPDATING entry for 20110427
2011-05-11 00:52:41 +00:00
marius
04f392fe12 Add an ATOMIC_CLEAR_LONG. 2011-05-10 21:18:45 +00:00
marius
90a44bc764 Fix whitespace. 2011-05-10 18:41:46 +00:00
marius
4c36b6d994 Fix a bug in r221407; this driver doesn't add the media itself.
PR:	156893
2011-05-10 18:38:01 +00:00
jkim
a112b2dac2 Add SC_PIXEL_MODE to GENERIC for amd64 and i386.
Requested by:	many
2011-05-10 16:44:16 +00:00
avg
2d672b24ae bitcount32: replace lengthy comment with a reference to SWAR
MFC after:	5 days
2011-05-10 15:08:13 +00:00
avg
f59b74bdc1 dtrace: remove unused code
Which is also useless, IMO.

MFC after:	5 days
2011-05-10 15:05:27 +00:00
nwhitehorn
668ea399d0 Only try to set up IPIs at boot on systems that actually have more than one
CPU. This fixes a panic observed on Heathrow-based systems without
SMP-capable PICs when the kernel had both options SMP and INVARIANTS.

MFC after:	5 days
2011-05-10 14:03:05 +00:00
jhb
6491e2a571 Add an entry for the SIIG Quartet Serial 850 which uses an Oxford
chip with a non-default clock.

PR:		kern/147583
MFC after:	1 week
2011-05-10 12:40:35 +00:00
adrian
7e859b0cd7 AR9285 (Kite) fixes.
* Correct some of the silicon revision checks to match what
  the Atheros HAL does. (See [1] below.)

* Move the PA cal and init cal method assignment to -after-
  the mac version/revision IDs are stored. The AR9285 init
  cal was never being called.

* Enable ANI.

Note Kite 1.0 and 1.1 were prototypes that shouldn't be seen
in the wild. Linux ath9k simply removed the prototype code from
their codebase. I'm going to leave it in there for now but
make it conditionally compilable in the future.

Obtained from:	Atheros
2011-05-10 04:32:27 +00:00
bms
25bebdda20 Add VID for Simtec Electronics.
Add PID for Simtec Electronics EntropyKey, a hardware random number generator.
2011-05-10 02:38:44 +00:00
mlaier
39f7e10a26 Another long standing vm bug found at Isilon:
Fix a race between vm_object_collapse and vm_fault.

Reviewed by:	alc@
MFC after:	3 days
2011-05-09 20:27:49 +00:00
yongari
dcff3b0693 Recognize BCM5719C PHY.
Submitted by:	Geans Pin at Broadcom
2011-05-09 20:20:43 +00:00
yongari
df88e7fa5f Since r117657, bge(4) does not enable buffer manager for BCM5705 or
newer controllers.  However, all data sheet I have access has no
indication that buffer manager should not be touched on these
controllers.  It seems the buffer manager always runs on BCM5705 or
newer controllers. Some controller(e.g. BCM5719) needs other buffer
manager configuration so driver should enable buffer manager for
all controllers.  Both Linux and OpenBSD/NetBSD use the same
approach.
This change polls enable bit of block to know whether specified
block was really stopped as well as enabling buffer manager for all
controllers in driver initialization.

Obtained from:	NetBSD
2011-05-09 20:10:46 +00:00
davidch
da17dba01e - Simplify multicast address programming.
- Fix an incorrect "uint32_t *" cast in bxe_set_rx_mode().

Submitted by:   yongari@
Approved by:    davidch@
MFC after:      Two weeks
2011-05-09 18:46:53 +00:00
jkim
7524282161 Move VT switching hack for suspend/resume from bus drivers to syscons.c
using event handlers.  A different version was

Submitted by:	Taku YAMAMOTO (taku at tackymt dot homeip dot net)
2011-05-09 18:46:49 +00:00
jkim
6d3172737b Implement boot-time TSC synchronization test for SMP. This test is executed
when the user has indicated that the system has synchronized TSCs or it has
P-state invariant TSCs.  For the former case, we may clear the tunable if it
fails the test to prevent accidental foot-shooting.  For the latter case, we
may set it if it passes the test to notify the user that it may be usable.
2011-05-09 17:34:00 +00:00
adrian
63b7280b18 Disable diversity combining support until I can get a firm answer
from Atheros as to what/when this is supposed to be enabled.

Using the default RX fast diversity settings seems to help quite
a bit.

Whilst I'm here, change the prototype to return HAL_BOOL rather than int.
2011-05-09 17:30:25 +00:00
adrian
4bfd669048 Fix a regression I introduced - only swap analog chains if the RX chainmask
is 0x5.
2011-05-09 17:10:48 +00:00
adrian
ca2d82df56 Disable TX STBC - it isn't used for now, but it isn't supported on Kite. 2011-05-09 16:49:40 +00:00
ed
a42bf7d6cd Add proper build infrastructure for teken.
I'm not sure whether we should install teken as a library on any stock
FreeBSD installation, but I can imagine people want to tinker around
with it now and then. Create a /sys/teken/libteken, which holds a
Makefile to install a shared library version of the terminal emulator,
complete with a manpage.

Also add Makefiles for the demo/stress applications, to build it against
the shared library.
2011-05-09 16:27:39 +00:00
hselasky
123df40267 Workaround for broken no-name USB audio devices sold by dealextreme
called "3D sound" and the alike.

MFC after:	14 days
2011-05-09 15:57:04 +00:00
adrian
08e0a0c638 Import some initial Kite fixed diversity code from Atheros.
For now, the diversity settings are controlled by 'txantenna',
-not- rxantenna. This is because the earlier chipsets had
controllable TX diversity; the RX antenna setting twiddles
the default antenna register. I'll try sort that stuff out at
some point.

Call the antenna switch function from the board setup function
so scans, channel changes, mode changes, etc don't set the
diversity back to a default state too far from what's intended.

Things to todo:

* Squirrel away the last antenna diversity/combining parameters
  and restore them during board setup if HAL_ANT_VARIABLE is
  defined. That way scans, etc don't reset the diversity settings.

* Add some more public facing statistics, rather than what's
  simply logged under HAL_DEBUG_DIVERSITY.

For now, the fixed antenna settings behave better than variable
settings for me. I have some further fiddling to do..

Obtained from:	Atheros
2011-05-09 15:19:49 +00:00
adrian
3592656c6f Remove an un-needed PA cal call here. 2011-05-09 14:04:49 +00:00
vanhu
684e2951a0 Release SP's refcount in key_get_spdbyid().
PR:	156676
Submitted by: Tobias Brunner (tobias@strongswan.org)
MFC after:	1 week
2011-05-09 13:16:21 +00:00
mav
5fe374103a Refactor TCP ISN increment logic. Instead of firing callout at 100Hz to
keep constant ISN growth rate, do the same directly inside tcp_new_isn(),
taking into account how much time (ticks) passed since the last call.

On my test systems this decreases idle interrupt rate from 140Hz to 70Hz.
2011-05-09 07:37:47 +00:00
adrian
a2816e3bed Fix the 5ghz fast clock logic.
The macro which I incorrectly copied into ah_internal.h assumed
that it'd be called with an AR_SREV_MERLIN_20() check to ensure
it was only enabled for Merlin (AR9280) silicon revision 2.0 or
later.

Trouble is, the 5GHz fast clock EEPROM flag is only valid for
EEPROM revision 16 or greater; it's assumed to be enabled
by default for Merlin rev >= 2.0. This meant it'd be incorrectly
set for AR5416 and AR9160 in 5GHz mode.

This would have affected non-default clock timings such as SIFS,
ACK and slot time. The incorrect slot time was very likely wrong
for 5ghz mode.
2011-05-08 15:55:52 +00:00
adrian
e8652e874e * Add AR_SREV_KITE macro for later use
* Modify AR_SREV_MERLIN_20() to match the Atheros/Linux ath9k behaviour -
  its supposed to match Merlin 2.0 and later Merlin chips.
  AR_SREV_MERLIN_20_OR_LATER() matches AR9280 2.0 and later chips
  (AR9285, AR9287, etc.)
2011-05-08 15:25:22 +00:00
ae
c286c25c24 Limit number of sectors that can be addressed.
MFC after:	1 week
2011-05-08 12:28:13 +00:00
bschmidt
fae1db6c96 Enable 11n (sans HT40) support. 2011-05-08 12:23:01 +00:00
ae
1dcde07c6f Limit number of sectors that can be addressed.
MFC after:	1 week
2011-05-08 12:20:30 +00:00
ae
37c4b4161f Limit number of sectors that can be addressed.
Reject table if blkcount from metadata is greater than provider.
2011-05-08 12:16:39 +00:00
bschmidt
03c359efa6 Notify firmware about various HT parameters once associated. 2011-05-08 12:11:20 +00:00
ae
a0e3009476 Limit number of sectors that can be addressed.
MFC after:	1 week
2011-05-08 12:11:16 +00:00
bschmidt
174adce103 Add support for TX packet aggregation. 2011-05-08 12:06:12 +00:00
bschmidt
0d4f015824 Add support for RX packet aggregation. 2011-05-08 11:58:23 +00:00
bschmidt
d5baa66cc1 Add support for transmitting frames at MCS rates. 2011-05-08 11:54:38 +00:00
bschmidt
8cc008f8dd Prepare for transmitting frames at MCS rates:
- instead of calling iwn_plcp_signal() for every frame, map the expected
  value directly within wn->ridx
- concat plcp, rflags and xrflags, there is no clean byte boundary within
  the flags, for example the antenna setting uses bit 6, 7 and 8
- there is still need for a custom rate to plcp mapping, as those expected
  by the hardware are not conform to the std
2011-05-08 11:49:50 +00:00
ae
45e0589617 Replace UINT_MAX to UINT32_MAX.
Pointed out by:	kib
MFC after:	1 week
2011-05-08 11:42:51 +00:00
ae
fb474a94c3 Limit number of sectors that can be addressed.
MFC after:	1 week
2011-05-08 11:20:27 +00:00
ae
4e0c05db9b Limit number of sectors that can be addressed.
MFC after:	1 week
2011-05-08 11:16:17 +00:00
bschmidt
141d7e265f Read chainmask information before announcing it. 2011-05-08 11:05:03 +00:00
bschmidt
641edf4468 Add HT capabilities to probe requests. 2011-05-08 11:03:16 +00:00
bschmidt
e4f441b16c Disable background scan support for 4965 adapters.
On legacy channels every once in a while the firmware throws a SYSASSERT
on line 208. On HT channels though this does always happen and I'm not
aware of any workaround currently.
2011-05-08 11:01:53 +00:00
bschmidt
b442b21ba0 RX aggregation is slightly different then the legacy path, we will only
receive one RX_PHY for each aggregate and not one RX_PHY per frame.
2011-05-08 10:57:44 +00:00
bschmidt
84a991c0b4 Allocate all TX rings, those will be use for TX packet aggregation. 2011-05-08 10:54:50 +00:00
bschmidt
9332775363 Use the enhanced TX power information availabe on newer EEPROMs. 2011-05-08 10:35:16 +00:00
bschmidt
21e2e4c106 Hook HT channel setup. 2011-05-08 10:31:22 +00:00
bschmidt
8a48a077f7 The 6000 series adapters have a slightly different offset for band 6,
2GHz HT40 channels.
2011-05-08 10:21:42 +00:00
bschmidt
938615cca5 Re-add 2 device IDs which got lost.
Pointed out by:	benjsc
2011-05-08 10:19:29 +00:00
pjd
2b4c44d1c2 Export GELI class version via sysctl kern.geom.eli.version.
MFC after:	1 week
2011-05-08 09:29:21 +00:00
pjd
ca83b3035d Version 6 is compatible with version 5 when it comes to control commands.
MFC after:	1 week
2011-05-08 09:25:54 +00:00
pjd
b2b06929c8 Detect and handle metadata of version 6.
MFC after:	1 week
2011-05-08 09:25:16 +00:00