Commit Graph

81103 Commits

Author SHA1 Message Date
Lawrence Stewart
1d4ed791d0 Import a clean-room implementation of the VEGAS congestion control algorithm
based on the paper "TCP Vegas: end to end congestion avoidance on a global
internet" by Brakmo and Peterson. It is implemented as a kernel module
compatible with the recently committed modular congestion control framework.

VEGAS uses network delay as a congestion indicator and unlike regular loss-based
algorithms, attempts to keep the network operating with stable queuing delays
and no congestion losses. By keeping network buffers used along the path within
a set range, queuing delays are kept low while maintaining high throughput.

In collaboration with:	David Hayes <dahayes at swin edu au> and
				Grenville Armitage <garmitage at swin edu au>
Sponsored by:	FreeBSD Foundation
Reviewed by:	bz and others along the way
MFC after:	3 months
2011-02-01 06:17:00 +00:00
Adrian Chadd
29e9b81e77 Add TX/RX chainmask info to if_ath - this is needed for the 11n TX rate series. 2011-02-01 04:39:15 +00:00
Adrian Chadd
94d748d2a9 Add a new capability which reports the number of spatial streams a device supports.
The higher levels (net80211, if_ath, ath_rate) need this to make correct
choices about what MCS capabilities to advertise and what MCS rates are
able to be TXed.

In summary:

* AR5416 - 2/3 antennas, 2x2 streams
* AR9160 - 2/3 antennas, 2x2 streams
* AR9220 - 2 antennas, 2x2 sstraems
* AR9280 - 2 antennas, 2x2 streams
* AR9285 - 2 antennas but with antenna diversity, 1x1 stream
2011-02-01 03:51:35 +00:00
Jack F Vogel
bf0477b215 Support for the new Patsburg PCH chipset:
- SMBus Controller
     - SATA Controller
     - HD Audio Controller
     - Watchdog Controller

Thanks to Seth Heasley (seth.heasley@intel.com) for providing us code.

MFC after 3 days
2011-02-01 01:05:11 +00:00
Adrian Chadd
59d7849bbd Remove the now unneeded XXX. 2011-01-31 22:45:14 +00:00
Adrian Chadd
a83df4d35d Enable AMPDU reorder processing and receiving BAR frames when doing 802.11n.
Obtained from:	rpaulo@
2011-01-31 22:44:28 +00:00
Pyun YongHyeon
a280fae7c3 alc_rev was used without initialization such that it failed to
apply AR8152 v1.0 specific initialization code. Fix this bug by
explicitly reading PCI device revision id via PCI accessor.

Reported by:	Gabriel Linder ( linder.gabriel <> gmail dot com )
2011-01-31 20:00:43 +00:00
Jack F Vogel
d5267ede37 Support for the new DH89xxCC PCH chipset including:
- SATA controller
      - Watchdog timer
      - SMBus controller
2011-01-31 18:41:52 +00:00
Adrian Chadd
d39a3a978b Don't incorrectly set the burst duration setting in the TX descriptor.
After inspecting the ath9k source, it seems the AR5416 and later MACs
don't take an explicit RTS/CTS duration. A per-scenario (ie, what multi-
rate retry became) rts/cts control flag and packet duration is provided;
the hardware then apparently fills in whatever details are required.
The per-rate sp/lpack duration calculation just isn't used anywhere
in the ath9k TX packet length calculations.

The burst duration register controls something different; it seems to
be involved with RTS/CTS protection of 11n aggregate frames and is set
via a call to ar5416Set11nBurstDuration().

I've done some light testing with rts/cts protected frames and nothing
seems to break; but this may break said RTS/CTS and CTS-to-self protection.
2011-01-31 15:42:42 +00:00
Randall Stewart
493d8e5a83 More ECN fixes:
1) We now remove ECN-Nonce since it will no longer continue as a I-D
2) Eliminate last_tsn_echo, this tied us to an assoc not the net
   and thus we were not doing m-homing on the ECN-Echo senders side right.
3) Increment the count going out even if the TSN in lower in the pending
   ECN-Echo, this way the receiver knows exactly how many packets were
   marked even with network re-ordering
4) Fix so we DO NOT stop doing delayed sack if a ECN Echo is in queue
MFC after:	1 month
2011-01-31 11:50:11 +00:00
Dmitry Chagin
78ec1867a2 Yet another unimplemented futex operation, print out about.
Submitted by:	arundel
MFC after:	1 month.
2011-01-31 06:06:23 +00:00
Dmitry Chagin
5163762354 Implement a futex BITSET op.
Submitted by:	arundel
MFC after:	1 month.
2011-01-31 05:59:05 +00:00
Bjoern A. Zeeb
63827f255c Update interface stats counters to match the current format in linux and
try to export as much information as we can match.

Requested on:	Debian GNU/kFreeBSD list (debian-bsd lists.debian.org) 2010-12
Tested by:	Mats Erik Andersson (mats.andersson gisladisker.se)
MFC after:	10 days
2011-01-31 00:09:52 +00:00
Alan Cox
3d05198e23 Release the free page queues lock earlier in vm_page_alloc().
Discussed with:	kib@
2011-01-30 23:55:48 +00:00
Dmitry Chagin
77192fddeb Regen for r218101.
MFC after:	1 Month.
2011-01-30 20:38:26 +00:00
Dmitry Chagin
8d73c2bfd1 Change linux futex syscall definition to match actual linux one.
MFC after:	1 Month.
2011-01-30 20:31:43 +00:00
Dmitry Chagin
9adaae9403 The kern_wait() code already removes the SIGCHLD signal for the waited
process. Removing other SIGCHLD signals is not needed and may cause
problems.

Pointed out by:	jilles

MFC after:	1 Month.
2011-01-30 18:17:38 +00:00
Bernhard Schmidt
7ca7a42ce6 Instead of always returning 0 to a scan request, indicate if there is
one running already.

MFC after:	1 month
2011-01-30 14:05:21 +00:00
Bernhard Schmidt
27612ff8c9 Change return code semantics of start_scan_locked(). Instead of reporting
if a scan is running, report if a scan has been started. The return value
itself is not (yet) used anywhere in the tree and it is also not exported
to userspace.

MFC after:	1 month
2011-01-30 14:00:50 +00:00
Adrian Chadd
a565668bc5 Add support for the m25p64; lifted straight from Linux.
This flash chip is found on the Ubiquiti LS-SR71 board.
I've successfully tested reading; I've not tried writing to it yet.
2011-01-30 12:14:06 +00:00
Bernhard Schmidt
abf0f91e13 Honor the IEEE80211_SCAN_BGSCAN flag, which makes it possible to actually
request a background scan using IEEE80211_IOC_SCAN_BGSCAN.

MFC after:	1 month
2011-01-30 11:23:59 +00:00
Nathan Whitehorn
5ad703e0c8 Fix boot on SMP systems after r218075 by delaying CPU binding until a
SYSINIT.

Reviewed by:	marcel
2011-01-29 23:26:28 +00:00
Bjoern A. Zeeb
7f79e7e4db Remove duplicate printing of TF_NOPUSH in db_print_tflags().
MFC after:	10 days
2011-01-29 22:11:13 +00:00
Marcel Moolenaar
3a47c0e263 Don't operate on the parent of the PCI node. It's the PCI node itself
that represents the host controller. This makes the FDT PCI support
working an a bare-bones manner. This needs a lot more work, of which
the beginning are at the end of the file, compiled-out with #if 0.

The intend being that both the Marvell PCIE and Freescale PCI/PCIX/PCIE
duplicate the same platform-independent domain initialization, that
should be moved into an unified implementation in the FDT code. Handling
of resources requires help from the platform. A unified implementation
allows us to properly support PCI devices listed in the device tree and
configured according to the device tree specification.

Sponsored by: Juniper Networks
2011-01-29 21:14:29 +00:00
Marcel Moolenaar
ac3fe75f97 Call newbus_device_create() for PCI devices. Call pci_from_fdt_node()
for the newly created device_t, rather than the parent.
2011-01-29 21:08:03 +00:00
Marcel Moolenaar
6d2d7b8c0d Fix the interrupt code, broken 7 months ago. The interrupt framework
already supported nested PICs, but was limited to having a nested
AT-PIC only. With G5 support the need for nested OpenPIC controllers
needed to be added. This was done the wrong way and broke the MPC8555
eval system in the process.

OFW, as well as FDT, describe the interrupt routing in terms of a
controller and an interrupt pin on it. This needs to be mapped to a
flat and global resource: the IRQ. The IRQ is the same as the PCI
intline and as such needs to be representable in 8 bits. Secondly,
ISA support pretty much dictates that IRQ 0-15 should be reserved
for ISA interrupts, because of the internal workins of south bridges.
Both were broken.

This change reverts revision 209298 for a big part and re-implements
it simpler. In particular:
o   The id() method of the PIC I/F is removed again. It's not needed.
o   The openpic_attach() function has been changed to take the OFW
    or FDT phandle of the controller as a second argument. All bus
    attachments that previously used openpic_attach() as the attach
    method of the device I/F now implement as bus-specific method
    and pass the phandle_t to the renamed openpic_attach().
o   Change powerpc_register_pic() to take a few more arguments. In
    particular:
    -   Pass the number of IPIs specificly. The number of IRQs carved
	out for a PIC is the sum of the number of int. pins and IPIs.
    -   Pass a flag indicating whether the PIC is an AT-PIC or not.
	This tells the interrupt framework whether to assign IRQ 0-15
	or some other range.
o   Until we implement proper multi-pass bus enumeration, we have to
    handle the case where we need to map from PIC+pin to IRQ *before*
    the PIC gets registered. This is done in a similar way as before,
    but rather than carving out 256 IRQs per PIC, we carve out 128
    IRQs (124 pins + 4 IPIs). This is supposed to handle the G5 case,
    but should really be fixed properly using multiple passes.
o   Have the interrupt framework set root_pic in most cases and not
    put that burden in PIC drivers (for the most part).
o   Remove powerpc_ign_lookup() and replace it with powerpc_get_irq().
    Remove IGN_SHIFT, INTR_INTLINE and INTR_IGN.

Related to the above, fix the Freescale PCI controller driver, broken
by the FDT code. Besides not attaching properly, bus numbers were
assigned improperly and enumeration was broken in general. This
prevented the AT PIC from being discovered and interrupt routing to
work properly. Consequently, the ata(4) controller stopped functioning.

Fix the driver, and FDT PCI support, enough to get the MPC8555CDS
going again. The FDT PCI code needs a whole lot more work.

No breakages are expected, but lackiong G5 hardware, it's possible
that there are unpleasant side-effects. At least MPC85xx support is
back to where it was 7 months ago -- it's amazing how badly support
can be broken in just 7 months...

Sponsored by: Juniper Networks
2011-01-29 20:58:38 +00:00
Marcel Moolenaar
696703e5ea Have nexus behave the same as the one on ARM (marvell SoCs), so as to
prevent warnings during boot WRT to the fdtbus attachment.
2011-01-29 20:28:17 +00:00
Marcel Moolenaar
2af3fc178e Introduce macro FDT_MAP_IRQ to map from an interrupt controller and
interrupt pin pair to a global IRQ number. When multiple PICs exist
on a board, the interrupt pin alone is not unique.
2011-01-29 20:25:20 +00:00
Randall Stewart
a21779f050 Fixes to ECN in SCTP.
1) ECN was on an association basis, this is incorrect and
   will not work with CMT or for that matter if the user
   is sending to multiple addresses. This commit makes
   ECN on a per path basis.
2) Adopt the new format for the ECN internet draft. This also
   maintains compatability with old format chunks as well.
3) Keep track of the real time of a RTT down to micro seconds.
   For some future conditional features (for like a data center
   this is good information to have).
MFC after:	1 month
2011-01-29 19:55:29 +00:00
Alan Cox
d2a444c0da Reenable the call to vm_map_simplify_entry() from vm_map_insert() for non-
MAP_STACK_* entries.  (See r71983 and r74235.)

In some cases, performing this call to vm_map_simplify_entry() halves the
number of vm map entries used by the Sun JDK.
2011-01-29 15:23:02 +00:00
Adrian Chadd
1e918679c6 Avoid writing CCA threshold values for the EXT radios for non-HT40 channels. 2011-01-29 14:36:31 +00:00
Adrian Chadd
c6c9d8c8ed Bring over some NF calibration changes from ath9k.
Each different radio chipset has a different "good" range of CCA
(clear channel access) parameters where, if you write something
out of range, it's possible the radio will go deaf.

Also, since apparently occasionally reading the NF calibration
returns "wrong" values, so enforce those limits on what is being
written into the CCA register.

Write a default value if there's no history available.

This isn't the case right now but it may be later on when "off-channel"
scanning occurs without init'ing or changing the NF history buffer.
(As each channel may have a different noise floor; so scanning or
other off-channel activity shouldn't affect the NF history of
the current channel.)
2011-01-29 14:27:20 +00:00
Adrian Chadd
7c913dea08 Fix some errors introduced w/ the last commit; fix setting RTS/CTS in the 11n rate scenario.
* I messed up a couple of things in if_athvar.h; so fix that.
* Undo some guesswork done in ar5416Set11nRateScenario() and introduce a
  flags parameter which lets the caller set a few things. To begin with,
  this includes whether to do RTS or CTS protection.
* If both RTS and CTS is set, only do RTS. Both RTS and CTS shouldn't be
  set on a frame.
2011-01-29 12:30:13 +00:00
Adrian Chadd
94b61069cc Link in the 11n specific TX methods into the HAL. 2011-01-29 12:16:26 +00:00
Adrian Chadd
b8e788a53a Migrate the TX path code out of if_ath and into a separate source file.
There's two reasons for this:

* the raw and non-raw TX path shares a lot of duplicate code which should be
  refactored;
* the 11n-ready chip TX path needs a little reworking.
2011-01-29 11:35:23 +00:00
Adrian Chadd
7efd41107b Add a check for the AR9285E; I have no idea what this is.
The only other changes in ath9k for the AR9285E revolve around sleep modes
which are not fully implemented here yet.
2011-01-29 08:52:06 +00:00
Dmitry Chagin
572fb2e33e My style(9) bug.
Pointed out by:	kib

MFC after:	1 Month.
2011-01-29 07:22:33 +00:00
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
Justin T. Gibbs
8577146eac Fix bug in the netfront driver that caused excessive packet drops during
receive processing.

Remove unnecessary restrictions on the mbuf chain length built during an
LRO receive.  This restriction was copied from the Linux netfront driver
where the LRO implementation cannot handle more than 18 discontinuities.
The FreeBSD implementation has no such restriction.

MFC after: 1 week
2011-01-29 02:36:45 +00:00
Andrew Turner
c8045145b7 Use bus space functions rather than inw/outw
to help a future port of the driver to ARM.

Approved by:	imp (mentor)
2011-01-29 00:53:58 +00:00
Andrew Turner
c08ce26e98 Move the load address of the kernel to the start of KVA as the
s3c24x0 copy of initarm expects the kernel to be loaded there.

Approved by:	imp (mentor)
2011-01-29 00:46:11 +00:00
Marcel Moolenaar
df0437ca6f Don't use the MAC address in the device tree if it's all zeroes
(i.e. 00-00-00-00-00-00). Use the currently programmed address
instead.

While here, simplify the function.
2011-01-28 23:40:13 +00:00
Randall Stewart
410bcbef0a Keep track of the real last RTT on each net.
This will be used for Data Center congestion
control, we won't want to engage it in the
ECN code unless we KNOW that the RTT is less
than 500us.

MFC after:	1 week
2011-01-28 21:05:21 +00:00
Pyun YongHyeon
f69ddfbb5f Fix logic error. Due to the bug, it incorrectly checked TXQ status
which in turn can leave TXQ active.

Submitted by:	Brad ( brad <> comstyle dot com )
MFC after:	3 days
2011-01-28 21:03:32 +00:00
Randall Stewart
d77e2e42b3 Fix a bug in the way ECN-Echo chunk
sends were being accounted for. The
counting was such that we counted only
when we queued a chunk, not when we sent it.
Now keep an additional counter for queuing and
one for sending.

MFC after:	1 week
2011-01-28 20:49:15 +00:00
Dmitry Chagin
596ba1bd95 Style(9) fixes.
MFC after:	1 Month.
2011-01-28 19:04:15 +00:00
Dmitry Chagin
adc7ece00a Implement a variation of the linux_common_wait() which should
be used by linuxolator itself.

Move linux_wait4() to MD path as it requires native struct
rusage translation to struct l_rusage on linux32/amd64.

MFC after:	1 Month.
2011-01-28 18:47:07 +00:00
Dmitry Chagin
53c74fc607 To avoid excessive code duplication move struct rusage translation
to a separate function.

MFC after:	1 Month.
2011-01-28 18:28:06 +00:00
Konstantin Belousov
9ca9fc5380 If more than one thread allocated sf buffers for sendfile(2), and
each of the threads needs more while current pool of the buffers is
exhausted, then neither thread can make progress.

Switch to nowait allocations after we got first buffer already.

Reported by:	az
Reviewed by:	alc (previous version)
Tested by:	pho
MFC after:	1 week
2011-01-28 17:37:09 +00:00
Jilles Tjoelker
90750179ec Do not trip a KASSERT if /dev/null cannot be opened for a setuid program.
The fdcheckstd() function makes sure fds 0, 1 and 2 are open by opening
/dev/null. If this fails (e.g. missing devfs or wrong permissions),
fdcheckstd() will return failure and the process will exit as if it received
SIGABRT. The KASSERT is only to check that kern_open() returns the expected
fd, given that it succeeded.

Tripping the KASSERT is most likely if fd 0 is open but fd 1 or 2 are not.

MFC after:	2 weeks
2011-01-28 15:29:35 +00:00
Andrey V. Elsukov
88007f6102 Add new user-friendly aliases for partition types for the MBR and
EBR schemes: fat32, ebr, linux-data, linux-raid, linux-swap and
linux-lvm. Add bios-boot GUID and alias for the GPT scheme. It used by
GRUB 2 loader. Also do sorting definitions of types in diskmbr.h
and in g_part.c.

PR:		bin/120990, kern/147664
MFC after:	2 weeks
2011-01-28 11:13:01 +00:00
Adrian Chadd
a6a308a4df (Mostly) teach ath_rate_sample about MCS rates.
This is just the bare minimum needed to teach ath_rate_sample to try
and handle MCS rates. It doesn't at all attempt to find the best
rate by any means - it doesn't know anything about the MCS rate
relations, TX aggregation or any of the much sexier 11n stuff
that's out there.

It's just enough to transmit 11n frames and handle TX completion.

It shouldn't affect legacy (11abg) behaviour.

Obtained from:	rpaulo@
2011-01-28 08:57:58 +00:00
Adrian Chadd
064e40d0ab Make space for the extended 802.11n MCS rate tables. 2011-01-28 08:45:19 +00:00
Adrian Chadd
d054f3a866 Bring in some 802.11n packet duration calculation functions from a mix of Sam/Rui and linux ath9k .
This will eventually be used by rate control modules and by the TX
code for calculating packet duration when handling rts/cts protection.

Obtained from:	sam@, rpaulo@, linux ath9k
2011-01-28 08:35:55 +00:00
Jayachandran C.
baa8c35cb4 CDDL fixes for MIPS n32.
Provide 64 bit atomic ops, and use 32 bit pointer.
2011-01-28 06:12:59 +00:00
Dmitry Chagin
d908c2d2a2 Style(9) fix.
MFC after:	1 month.
2011-01-28 05:42:14 +00:00
Konstantin Belousov
77185f473b linux_sigreturn() loads the struct trapframe from l_sigcontext
members, thus making a signed extension of 32 bit register
context. If the register is not touched in usermode between
return from signal and next syscall entry, the sign-extension
part of 64bit register is not cleared, causing
linux32_fetch_syscall_args() to read wrong values.

Use unsigned type for the registers in the linux sigcontext.

Reported by:	Jacob Frelinger <jacob.frelinger duke edu>, arundel
In collaboration with:	dchagin
MFC after:	1 week
2011-01-27 21:45:38 +00:00
Konstantin Belousov
4a13a769dc Add support for BIO_DELETE on swap-backed md(4). In the case of BIO_DELETE
covering the whole page, free the page. Otherwise, clear the region and
mark it clean. Not marking the page dirty could reinstantiate cleared
data, but it is allowed by BIO_DELETE specification and saves unneeded
write to swap.

Reviewed by:	alc
Tested by:	pho
MFC after:	2 weeks
2011-01-27 16:10:25 +00:00
Jayachandran C.
21835e695a Implement sf_buf using direct map (XKPHYS) in MIPS n64.
- Provide trivial implementation of sf_buf_alloc(), sf_buf_free(),
  sf_buf_kva() and sf_buf_page() using direct map for n64.
- uio_machdep.c - use macros so that the direct map will be used in
  case of n64.

Reviewed by:	imp (earlier version)
Obtained from:	jmallett (user/jmallett/octeon)
2011-01-27 14:49:22 +00:00
Adrian Chadd
0fafe07ff3 Initialise the chainmask from the EEPROM rather than the hard-coded defaults.
The defaults enabled three chains on the AR5416 even if the card has two
chains. This restores that and ensures that only the correct TX/RX
chainmasks are used.

When HT modes are enabled, all TX chains will be correctly enabled.

This should now enable analog chain swapping with 2-chain cards.
I'm not sure if this is needed for just the AR5416 or whether
it also applies to AR9160, AR9280 and AR9287 (later on); I'll have
to get clarification.
2011-01-27 09:26:37 +00:00
Adrian Chadd
4ceb85596b Add missing getCapability call for AR5416. 2011-01-27 08:42:50 +00:00
Andrey V. Elsukov
1313160649 While inspecting the disklabel check that start offset of partition is
within provider's bounds. If not then reject this disklabel.
Mark bbarea as NULL to do not free it again in destroy method.

MFC after:	1 week
2011-01-27 08:02:26 +00:00
Adrian Chadd
51fcc8350c Make a note to re-check whether that particular check is needed. 2011-01-27 07:33:17 +00:00
George V. Neville-Neil
64181ef324 Quick fix to a comment. 2011-01-27 03:32:16 +00:00
Adrian Chadd
6ef699a0a6 Writing to the analog registers on the AR9220 (Merlin PCI) seems to require a delay.
This, along with an initval change which will appear in a subsequent commit,
fixes bus panics that I have been seing with the AR9220 on a Routerstation Pro
(AR7161 MIPS board.)

Obtained from: Linux ath9k
PR: kern/154220
2011-01-27 02:56:03 +00:00
Matthew D Fleming
00f0e671ff Explicitly wire the user buffer rather than doing it implicitly in
sbuf_new_for_sysctl(9).  This allows using an sbuf with a SYSCTL_OUT
drain for extremely large amounts of data where the caller knows that
appropriate references are held, and sleeping is not an issue.

Inspired by:	rwatson
2011-01-27 00:34:12 +00:00
Matthew D Fleming
73d6f8516d Remove the CTLFLAG_NOLOCK as it seems to be both unused and
unfunctional.  Wiring the user buffer has only been done explicitly
since r101422.

Mark the kern.disks sysctl as MPSAFE since it is and it seems to have
been mis-using the NOLOCK flag.

Partially break the KPI (but not the KBI) for the sysctl_req 'lock'
field since this member should be private and the "REQ_LOCKED" state
seems meaningless now.
2011-01-26 22:48:09 +00:00
Michael Tuexen
f8cdf87663 * Use 300 ms as the default for RTO_MIN.
* Disable burst mitigation by default.
* Remove unused constant.
Discussed with rrs.
MFC after: 3 months.
2011-01-26 21:38:17 +00:00
Pyun YongHyeon
54899a96e1 Add support for RTL8105E PCIe Fast Ethernet controller. It seems
the controller has a kind of embedded controller/memory and vendor
applies a large set of magic code via undocumented PHY registers in
device initialization stage. I guess it's a firmware image for the
embedded controller in RTL8105E since the code is too big compared
to other DSP fixups. However I have no idea what that magic code
does and what's purpose of the embedded controller. Fortunately
driver seems to still work without loading the firmware.

While I'm here change device description of RTL810xE controller.

H/W donated by:	Realtek Semiconductor Corp.
2011-01-26 21:14:20 +00:00
Pyun YongHyeon
ed072c9d1a Add Realtek RTL8201E 10/100 PHY found in RTL8105E controller. The
exact model name is not clear yet. All previous RTL8201 10/100 PHYs
used 0x8201 in MII_PHYIDR2 which in turn makes model number 0x20
but this PHY used new model number 0x08.
2011-01-26 21:07:44 +00:00
Pyun YongHyeon
502be0f749 Do not use interrupt taskqueue on controllers with MSI/MSI-X
capability. One of reason using interrupt taskqueue in re(4) was
to reduce number of TX/RX interrupts under load because re(4)
controllers have no good TX/RX interrupt moderation mechanism.
Basic TX interrupt moderation is done by hardware for most
controllers but RX interrupt moderation through undocumented
register showed poor RX performance so it was disabled in r215025.
Using taskqueue to handle RX interrupt greatly reduced number of
interrupts but re(4) consumed all available CPU cycles to run the
taskqueue under high TX/RX network load.  This can happen even with
RTL810x fast ethernet controller and I believe this is not
acceptable for most systems.

To mitigate the issue, use one-shot timer register to moderate RX
interrupts. The timer register provides programmable one-shot timer
and can be used to suppress interrupt generation. The timer runs at
125MHZ on PCIe controllers so the minimum time allowed for the
timer is 8ns. Data sheet says the register is 32 bits but
experimentation shows only lower 13 bits are valid so maximum time
that can be programmed is 65.528us. This yields theoretical maximum
number of RX interrupts that could be generated per second is about
15260. Combined with TX completion interrupts re(4) shall generate
less than 20k interrupts. This number is still slightly high
compared to other intelligent ethernet controllers but system is
very responsive even under high network load.

Introduce sysctl variable dev.re.%d.int_rx_mod that controls amount
of time to delay RX interrupt processing in units of us. Value 0
completely disables RX interrupt moderation. To provide old
behavior for controllers that have MSI/MSI-X capability, introduce
a new tunable hw.re.intr_filter. If the tunable is set to non-zero
value, driver will use interrupt taskqueue. The default value of
the tunable is 0. This tunable has no effect on controllers that
has no MSI/MSI-X capability or if MSI/MSI-X is explicitly disabled
by administrator.

While I'm here cleanup interrupt setup/teardown since re(4) uses
single MSI/MSI-X message at this moment.
2011-01-26 20:25:40 +00:00
Dmitry Chagin
a5c1afadeb Add macro to test the sv_flags of any process. Change some places to test
the flags instead of explicit comparing with address of known sysentvec
structures.

MFC after:	1 month
2011-01-26 20:03:58 +00:00
Michael Tuexen
507c72969d Make SCTP_MAX_BURST compliant with the latest version of
the socket API ID. This is not compatible with the API
in stable/8.
2011-01-26 19:55:54 +00:00
Michael Tuexen
90fed1d88e Change infrastructure for SCTP_MAX_BURST to allow compliance
with the latest socket API ID. Especially it can be disabled.

Full compliance needs changing the structure used in the
socket option. Since this breaks the API, it will be a
seperate commit which will not be MFCed to stable/8.

MFC after: 3 months.
2011-01-26 19:49:03 +00:00
Daniel Eischen
e691be70f9 Prison check addresses set with multicast interface options.
Reviewed by:	bz
MFC after:	1 week
2011-01-26 17:31:03 +00:00
Matthew D Fleming
f89f7ada8d Set td_kstack_pages for thread0. This was already being done for most
architectures, but i386 and amd64 were missing it.

Submitted by:	Mohd Fahadullah <mfahadullah AT isilon DOT com>
2011-01-26 17:06:13 +00:00
Alexander Motin
7f63cad89e Add missing part of r217877. 2011-01-26 13:10:07 +00:00
Adrian Chadd
f68a9f06e1 Add ar5416RestoreChainMask() which will undo any AR5416 specific chainmask
overriding after calibration.

This will get set for other two chain radios, such as AR9280 and later on,
AR9287. It should however be a nul operation.
2011-01-26 10:48:29 +00:00
Adrian Chadd
b868c6d0b1 Add an AR5416 workaround - force a different bias based on 2.4ghz channel frequency.
Obtained from:	Linux ath9k
2011-01-26 10:36:43 +00:00
Konstantin Belousov
0ea2e01412 Treat async buffer writes from the gjournal switcher thread the same as
from syncer. We shall not sleep on running buffer space when suspending.

Reproduced and tested by:	pho
PR:	kern/154228
MFC after:	1 week
2011-01-26 10:34:21 +00:00
Adrian Chadd
60a507a514 Break out the chainmask init code into a new function - ar5416InitChainMasks() .
ath9k does a few different things here during config - if it's an early
AR5416 with two chains, it enables all three chains for calibration and
then restores the chainmask to the original values after initial
calibration has completed.

The reason behind this commit is to begin breaking out the chainmask
configuration for this specific reason; follow-up commits will add
the chainmask restore in the ar5416Reset() routine.
2011-01-26 10:08:37 +00:00
Adrian Chadd
5a2def3a5e * fix HAL_DEBUG_INTERRUPT to be a separate bit, it was overlapping with
something else
* add HAL_DEBUG_GPIO, for some GPIO related debugging I'm tinkering with
  at the moment.
2011-01-26 09:37:43 +00:00
Alexander Motin
a59641a90d Hardware supported by siis(4) allows software control over activity LEDs.
Expose that functionality to led(4) OR-ing it with regular LED activity.
2011-01-26 08:54:10 +00:00
Alexander Motin
025e2c1221 In addition to r217444 ignore also ATA status errors on DMA Auto-Activation
enabling request. Some HP disks reported to return ABORT error there while
declaring support for this feature.
2011-01-26 06:57:48 +00:00
Alexander Motin
958e4a696f Make device initialization sequence shorter when possible. Do not enable/
disable already enabled/disabled SATA features.
2011-01-26 06:37:51 +00:00
Pyun YongHyeon
d180a66f19 Remove TX taskqueue and directly invoke re_start in interrupt task. 2011-01-25 23:27:28 +00:00
Pyun YongHyeon
4a58fd452a Prefer MSI-X to MSI on controllers that support MSI-X. All
recent PCIe controllers(RTL8102E or later and RTL8168/8111C or
later) supports either 2 or 4 MSI-X messages. Unfortunately vendor
did not publicly release RSS related information yet. However
switching to MSI-X is one-step forward to support RSS.
2011-01-25 22:18:00 +00:00
Pyun YongHyeon
f9ad4da76d Disable TSO for all Realtek controllers. Experimentation showed
RTL8111C generated corrupted frames where TCP option header was
broken. All other sample controllers I have did not show such
problem so it could be RTL8111C specific issue. Because there are
too many variants it's hard to tell how many controllers have such
issue. Just disable TSO by default but have user override it.
2011-01-25 19:05:46 +00:00
Andrew Thompson
965615476e When matching an incoming ARP against a bridge, ensure both interfaces belong
to the same bridge.

Submitted by:	Alexander Zagrebin
2011-01-25 17:15:23 +00:00
Konstantin Belousov
dbccdf7684 When vtruncbuf() iterates over the vnode buffer list, lock buffer object
before checking the validity of the next buffer pointer. Otherwise, the
buffer might be reclaimed after the check, causing iteration to run into
wrong buffer.

Reported and tested by:	pho
MFC after:	1 week
2011-01-25 14:04:02 +00:00
Konstantin Belousov
96410b9575 Bio shall not be accessed after g_io_deliver(9).
Reported and tested by:	pho
Reviewed by:	ae, phk
MFC after:	1 week
2011-01-25 14:00:30 +00:00
Konstantin Belousov
6fa39a7327 Allow debugger to specify that children of the traced process should be
automatically traced. Extend the ptrace(PL_LWPINFO) to report that child
just forked.

Reviewed by:	davidxu, jhb
MFC after:	2 weeks
2011-01-25 10:59:21 +00:00
Adrian Chadd
3545027dc3 * Re-format the v4k header to be consistent
* Re-do the structure size/component math to make sure the struct matches
  the expected size
* Just to be clear that we care about bitmask ordering, revert my previous
  change and instead define that macro if we're on big-endian.
2011-01-25 07:37:12 +00:00
Adrian Chadd
6468b2baa5 Bring over a fix from ath9k - zero some of the TX descriptors for Kite/AR9285.
Kite doesn't have per-chain control (it has one chain) or antenna control; so
don't try to set those descriptor entries.
2011-01-25 05:47:50 +00:00
Adrian Chadd
2b020858f9 Rename this linux-ism __BIG_ENDIAN_BITFIELD macro to something suitable for FreeBSD.
Warner has pointed out that FreeBSD's bit orders follow byte orders.
2011-01-25 05:41:36 +00:00
Adrian Chadd
d55a8a09e8 Commit updated AR9285 (Kite) v2 initvals from ath9k. 2011-01-25 05:36:29 +00:00
Adrian Chadd
fb14f71662 Fix the Atheros V4K EEPROM definitions to match those in ath9k.
It turns out that the V4K eeprom definitions (used by the AR9285 and
its derivatives) is wrong. These values are at least causing issues
on my AR2427.

With this fix (and initvals in a subsequent commit), the AR2427 behaves
a lot better.

Note - there's still significant drift between the ath9k v4k eeprom
init code (again, used by AR9285 and derivatives) and what's in this
tree. That needs to be investigated and resolved.
2011-01-25 05:35:09 +00:00
Lawrence Stewart
050570efa7 Import the ERTT (Enhanced Round Trip Time) Khelp module. ERTT uses the
Khelp/Hhook KPIs to hook into the TCP stack and maintain a per-connection, low
noise estimate of the instantaneous RTT. ERTT's implementation is robust even in
the face of delayed acknowledgements and/or TSO being in use for a connection.

A high quality, low noise RTT estimate is a requirement for applications such as
delay-based congestion control, for which we will be importing some algorithm
implementations shortly.

In collaboration with:	David Hayes <dahayes at swin edu au> and
				Grenville Armitage <garmitage at swin edu au>
Sponsored by:	FreeBSD Foundation
Reviewed by:	bz and others along the way
MFC after:	3 months
2011-01-24 23:08:38 +00:00
John Baldwin
5f3b301a43 Fix a LOR by dropping the global ifnet locks while allocating a new ifnet
table in if_grow().  The order of the SYSINIT's for ifnet state were swapped
so that the various locks were initialized before being used.

Reviewed by:	pluknet, bz
MFC after:	2 weeks
2011-01-24 22:21:58 +00:00
Marcel Moolenaar
f1fb96475a In uart_tty_outwakeup(), check CTS/RTS flow control settings and
prevent sending data when CTS is de-asserted.
In uart_tty_intr(), call uart_tty_outwakeup() when the CTS signal
changed, knowing that uart_tty_outwakeup() will do the right
thing for flow control. This avoids redundant conditionals.

PR:		kern/148644
Submitted by:	John Wehle <john@feith.com>
MFC after:	3 days
2011-01-24 18:34:16 +00:00
Pyun YongHyeon
4de89d86cd Reinitialize driver when MTU is changed and driver is running.
Reported by:	Huang, Yusheng ( yusheng.huang <> bluecoat com )
2011-01-24 17:53:58 +00:00
Hans Petter Selasky
99f017d21b Add more sanity checks for USB_HOST_ALIGN input values. Re-factor existing
checks for readability.

Approved by:	thompsa (mentor)
2011-01-24 17:38:37 +00:00
Jaakko Heinonen
1a4fbae871 Replace spaces with tabs. 2011-01-24 17:08:26 +00:00
Adrian Chadd
514539dcbd Remove an invalid register setup; this is likely a holdover from
the AR5212 code. It doesn't exist in ath9k and I've been told it
doesn't exist in the Atheros internal driver.
2011-01-24 17:03:22 +00:00
Alexander Motin
f1bfc8aba8 ICH7 SATA controller in legacy mode can provide access to SATA registers
via AHCI-like memory resource at BAR(5). Use it if BIOS was so kind to
allocate memory for that BAR. This allows hot-plug support and connection
speed reporting.

MFC after:	2 weeks
2011-01-24 09:24:20 +00:00
Lawrence Stewart
6987b09f93 Add build infrastructure for Khelp modules.
Sponsored by:	FreeBSD Foundation
Reviewed by:	bz
MFC after:	3 months
2011-01-24 07:50:29 +00:00
Adrian Chadd
7e01b4d78c Undo a local option which mistakenly crept into a commit. 2011-01-24 07:45:14 +00:00
Pyun YongHyeon
7be4de2de7 Apply TX interrupt moderation to all RTL810xE PCIe Fast Ethernet
controllers. Experimentation with RTL8102E, RTL8103E and RTL8105E
showed dramatic decrement of TX completion interrupts under high TX
load(e.g.  from 147k interrupts/second to 10k interrupts/second)
With this change, TX interrupt moderation is applied to all
controllers except RTL8139C+.
2011-01-24 00:01:06 +00:00
Michael Tuexen
f7a77f6fd3 Add stream scheduling support.
This work is based on a patch received from Robin Seggelmann.

MFC after: 3 months.
2011-01-23 19:36:28 +00:00
Nathan Whitehorn
a0a3479c06 Disable ATAPI DMA unconditionally on Apple Kauai ATA controllers, like it
is on the MacIO ones. It appears to be unreliable on all DBDMA-based
controllers for unknown reasons, which should be figured out eventually.

Tested by:	Torfinn Ingolfsen
MFC after:	1 week
2011-01-23 17:20:11 +00:00
Adrian Chadd
d8d0c29db8 Enable the 11n PHY by default whether or not 11n is configured.
The linux ath9k driver and (from what I've been told) the atheros reference
driver does this; it then leaves discarding 11n frames to the 802.11 layer.

Whilst I'm here, merge in a fix from ath9k which maintains a turbo register
setting when enabling the 11n register; and remove an un-needed (duplicate)
flag setting.
2011-01-23 14:49:50 +00:00
Adrian Chadd
69d1f737f8 Update the AR9280v2 inivals to match what is in Linux ath9k.
This repairs the behaviour of my AR9280 - both radio chains now seem
to correctly be receiving.
2011-01-23 14:30:35 +00:00
Lawrence Stewart
a66ac850d7 An sbuf configured with SBUF_AUTOEXTEND will call malloc with M_WAITOK when a
write to the buffer causes it to overflow. We therefore can't hold the CC list
rwlock over a call to sbuf_printf() for an sbuf configured with SBUF_AUTOEXTEND.

Switch to a fixed length sbuf which should be of sufficient size except in the
very unlikely event that the sysctl is being processed as one or more new
algorithms are loaded. If that happens, we accept the race and may fail the
sysctl gracefully if there is insufficient room to print the names of all the
algorithms.

This should address a WITNESS warning and the potential panic that would occur
if the sbuf call to malloc did sleep whilst holding the CC list rwlock.

Sponsored by:	FreeBSD Foundation
Reported by:	Nick Hibma
Reviewed by:	bz
MFC after:	3 weeks
X-MFC with:	r215166
2011-01-23 13:00:25 +00:00
Konstantin Belousov
b7f0fc351e Fix typo.
MFC after:	3 days
2011-01-23 12:44:17 +00:00
Dmitry Chagin
9a6a64d3c4 Style(9) fix.
Approved by:	kib(mentor)
MFC after:	1 month
2011-01-23 09:50:39 +00:00
Michael Tuexen
afb048b8ef Remove unnecessary checking of variable.
MFC after: 3 months.
2011-01-23 07:27:35 +00:00
Andrew Thompson
d929b72e23 Revert the ndis part of r212122, windrv_stub.c already adds a MODULE_VERSION
and this breaks loading miniport drivers from loader.conf

Reported by:	Yuri <yuri^rawbw^com>
Submitted by:	Paul B Mahol
MFC after:	3 days
2011-01-22 21:33:18 +00:00
Dmitry Chagin
fd4194ca26 Option USB_HOST_ALIGN declared twice.
Approved by:	kib(mentor)
2011-01-22 20:53:27 +00:00
Hans Petter Selasky
d8d1becfdd Allow USB_HOST_ALIGN to be configured at compile time. This patch is
necessary for MIPS based RouterStation Pro board and maybe other MIPS
based boards as well.

Submitted by:	Milan Obuch
Approved by:	thompsa (mentor)
2011-01-22 13:52:23 +00:00
Marcel Moolenaar
b2b953afee Fix r217688. We need to call init_param1() before we use msgbufsize,
now that the size of the message buffer is a tunable.
2011-01-22 01:31:59 +00:00
Marcel Moolenaar
4cdbe2b967 Fix backtraces by defining ksym_start & ksym_end if DDB is
defined. The kernel linker doesn't deal with symbols of
type NOTYPE and typically gives the wrong symbol ($a) for
local symbols.

Obtained from:  Juniper Networks, Inc.
2011-01-22 00:32:12 +00:00
Jack F Vogel
7d5f64a903 Don't bother to run the flowcontrol code if there
is no change. Thanks to Andrew for the tweak.
2011-01-22 00:19:15 +00:00
Jack F Vogel
1d4e0b19e4 Missing case for 82598DA type adapter, thanks Andrew. 2011-01-22 00:08:06 +00:00
Jack F Vogel
c6f98cde15 Leftover bogus TX UNLOCK removed. Thanks to
Andrew Boyer.
2011-01-21 23:55:28 +00:00
John Baldwin
cd2895aab0 - Move special inode constants to ext2_dinode.h and rename them to match
NetBSD.
- Add a constant for the HASJOURNAL compat flag.

PR:		kern/153584
Submitted by:	Pedro F. Giffuni  giffunip at yahoo
2011-01-21 22:00:40 +00:00
John Baldwin
84edda0a2c Restore support for the 'async' and 'sync' mount options lost when
switching to nmount(2).  While here, sort the options.

PR:		kern/153584
Submitted by:	Pedro F. Giffuni  giffunip at yahoo
MFC after:	1 week
2011-01-21 21:33:46 +00:00
Sergey Kandaurov
03139a7106 Add kern.msgbufsize default setting to /boot/defaults/loader.conf.
Suggested by:	Alex Kozlov <spam rm-rf.kiev.ua> (via private mail)
Approved by:	kib (mentor)
2011-01-21 12:15:21 +00:00
Sergey Kandaurov
4053b05b91 Make MSGBUF_SIZE kernel option a loader tunable kern.msgbufsize.
Submitted by:	perryh pluto.rain.com (previous version)
Reviewed by:	jhb
Approved by:	kib (mentor)
Tested by:	universe
2011-01-21 10:26:26 +00:00
Adrian Chadd
409daaf37b Fix some typos. 2011-01-21 07:28:48 +00:00
Adrian Chadd
25580e3f63 Add missing getCapability call for AR5416. 2011-01-21 07:26:53 +00:00
Adrian Chadd
a5314ffdf0 Modify the v14/v4k eeprom diag interface to return the whole eeprom.
The v1 and v3 interfaces returned the whole EEPROM but the v14/v4k
interfaces just returned the base header. There's extra information
outside of that which would also be nice to get access to.
2011-01-21 06:42:25 +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
Lawrence Stewart
47f44cdd93 Some correctness and robustness fixes related to CUBIC's mean RTT estimate:
- The mean RTT is updated at the end of each congestion epoch, but if we switch
  to congestion avoidance within the first epoch (e.g. if ssthresh was primed
  from the hostcache), we'll trigger a divide by zero panic in
  cubic_ack_received(). Set the mean to the min in cubic_record_rtt() if the
  mean is less than the min to ensure we have a sane mean for use in this
  situation. This fixes the panic reported by Nick Hibma.

- Adjust conditions under which we update the mean RTT in cubic_post_recovery()
  to ensure a low latency path won't yield an RTT of less than 1. This avoids
  another potential divide by zero panic when running CUBIC in networks with
  sub-millisecond latencies.

- Remove the "safety" assignment of min into mean when we don't update the mean
  because of failed conditions. The above change to the conditions for updating
  the mean ensures the safety issue is addressed and I feel it is better to keep
  our previous mean estimate around if we can't update than to revert to the
  min.

- Initialise the mean RTT to 1 on connection startup to act as a safety belt if
  a situation we haven't considered and addressed with the above changes were to
  crop up in the wild.

Sponsored by:	FreeBSD Foundation
Reported and tested by:	Nick Hibma
Discussed with:	David Hayes <dahayes at swin edu au>
MFC after:	5 weeks
X-MFC with:	r216114
2011-01-21 05:19:47 +00:00
Juli Mallett
2e2b4ad457 If there is no WQE available for a packet that needs segmentation, drop it
and return.
2011-01-20 23:51:03 +00:00
Juli Mallett
3e46966ed3 Remove some compile-time options from the driver, particularly async IOBDMA
support which is unused on FreeBSD and which complicates working on the
code now, can easily be added back later by someone determined to use it.
2011-01-20 23:34:59 +00:00
Warner Losh
87c44314f9 No need to list an obsolete arm compiler here. 2011-01-20 22:58:10 +00:00
Andreas Tobler
639d24ce02 Remove unused variables. Spotted by a cppcheck
(devel/cppcheck, http://sourceforge.net/projects/cppcheck) run.

Approved by: nwhitehorn (mentor)
2011-01-20 20:23:03 +00:00
Andreas Tobler
d328763f19 Correct parsing of the grackle and uninorthpci ranges property.
Approved by: nwhitehorn (mentor)
2011-01-20 20:22:19 +00:00
Warner Losh
22236d5f21 Don't need __DYNAMIC here. it is commented out and a.out only -- these are all ELF. 2011-01-20 19:26:28 +00:00
Warner Losh
6ba63f2d8c In fact, we don't need any of these __DYNAMIC. it is a.out leftover and commented out. 2011-01-20 19:24:50 +00:00
Warner Losh
e35d9de240 Remove commented out _DYNAMIC sections. 2011-01-20 19:20:23 +00:00
Warner Losh
266a41b11e Use simplified ldscripts rather than specific ones 2011-01-20 19:17:05 +00:00
Warner Losh
039e1e51f2 We don't need 2 versions here. One will do since binutils outputs the right stuff now. 2011-01-20 19:16:29 +00:00
Warner Losh
38fed21159 Collapse all the octeon ldscripts down into one now that we don't need one each for all the wacky ABIs 2011-01-20 19:09:02 +00:00
Pyun YongHyeon
c27d7a76fc Correct wrong definition of PM timer mask and adjust L1/PM timer
value. While I'm here enable all clocks before initializing
controller. This change should fix lockup issue seen on AR8152
v1.1 PCIe Fast Ethernet controller.

PR:	kern/154076
MFC after:	3 days
2011-01-20 18:26:33 +00:00
John Baldwin
deaff01fe5 Fix a stack leak in r215345 when skipping over the ACPI menu item for
machines that do not support ACPI.

Submitted by:	olli
2011-01-20 16:03:28 +00:00
Adrian Chadd
1e659efff7 ar9280SetAntennaSwitch() was using the AR5416 chainmasks (3 chains)
rather than the AR9280 chainmasks (2 chains)
2011-01-20 15:09:11 +00:00
Nathan Whitehorn
1161b88d4a Correct parsing of the cpcht ranges property.
Submitted by:	andreast
MFC after:	2 weeks
2011-01-20 15:02:51 +00:00
Michael Tuexen
91f17c6faa Improve comments.
MFC after: 1 week.
2011-01-20 13:53:34 +00:00
Nick Hibma
0223e98a7e Add another ID for the ZTE MF190 Surf Stick
Submitted by:	nagilum
MFC after:	1 day
2011-01-20 13:02:54 +00:00
Jayachandran C.
8026971f99 Move 'cpu CPU_RMI' to std.xlr, this is common for all XLR cpus. 2011-01-20 12:45:29 +00:00
Randall Stewart
a97009a5cd Fix it so we align with new socket API draft for
state's in destination (i.e. ACTIVE/INACTIVE/UNCONFIRMED)

MFC after:	1 week
2011-01-20 12:40:09 +00:00
Adrian Chadd
c44797fc39 Only enable 11n modes if the chipset suports 11n.
Since the AR2427 doesn't allow 802.11n, it shouldn't have them
configured.
2011-01-20 09:46:18 +00:00
Konstantin Belousov
9fb9c623a6 In tmpfs_readdir(), normalize handling of the directory entries that
either overflow the supplied buffer, or cause uiomove fail.
Do not advance cached de when directory entry was not copied out.
Do not return EOF when no entries could be copied due to first entry
too large for supplied buffer, signal EINVAL instead.

Reported by:	Beat G?tzi <beat chruetertee ch>
MFC after:	1 week
2011-01-20 09:39:16 +00:00
Adrian Chadd
1d6334ce30 Include the device ids for the AR2427.
This is apparently an AR9285 with the 802.11n specific bits disabled.

This code is completely untested; I'm doing this in response to users
who wish to test the functionality out. It's likely as buggy as the
AR9285 support is in FreeBSD at the moment.
2011-01-20 09:37:53 +00:00
Adrian Chadd
204582f2f3 Push the non-AR5416 related stuff into chipset specific directories.
sys/dev/ath/ath_hal/ar5416/ is getting very crowded and further
commits will make it even more crowded. Now is a good time to
shuffle these files out before any more extensive work is done
on them.

Create an ar9003 directory whilst I'm here; ar9003 specific
chipset code will eventually live there.
2011-01-20 09:03:40 +00:00
Jayachandran C.
e91c7635e9 Re-format XLR configuartion files and remove obsolete options. 2011-01-20 09:01:14 +00:00
Adrian Chadd
564e7aea54 Add a comment from my local HAL about what is actually going on here
with these ADC DC Gain/Offset calibrations.

The whole idea is to calibrate a pair of ADCs to compensate for any
differences between them.

The AR5416 returns lots of garbage, so there's no need to do the
calibration there.

The AR9160 returns 0 for secondary ADCs when calibrating 2.4ghz 20mhz
modes. It returns valid data for the secondary ADCs when calibrating
2.4ghz HT/40 and any 5ghz mode.
2011-01-20 08:40:22 +00:00
Adrian Chadd
bd97c52a22 Migrate the sample rate module to the new ath_hal_gettxcompletionrates() API.
This removes the chipset-dependent TX DMA completion descriptor groveling.
It should now be (more) portable to other, later atheros chipsets when the
time comes.
2011-01-20 08:19:23 +00:00
Adrian Chadd
82d2927d95 Add in the public method to access the tx completion rates. 2011-01-20 08:15:46 +00:00
Jayachandran C.
c400881470 ldscript and conf cleanup for MIPS
- Remove sys/conf/ldscript.mips.64 and sys/conf/ldscript.mips.n32 and use
  ldscript.mips for all ABIs. The default OUTPUT_FORMAT of the toolchain
  is correct.
- Remove LDSCRIPT_NAME entires from XLR n32 and n64 conf files.
- Remove TARGET_BIG_ENDIAN from XLR conf files.
- Fix machine entry in XLRN32
2011-01-20 08:15:11 +00:00
Jayachandran C.
1104442832 Fixes in the XLR platform code
- Fix bug in pic.h, assign reg variable, before return.
- In xlr_pci.c, need to ignore the result of mmio read.
2011-01-20 08:08:19 +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
c485136b7f Port over another EEPROM option from ath9k - AR_EEP_DAC_HPWR_5G
This will be used by the temperature compensation calibration code
which will shortly make an appearance.
2011-01-20 07:42:39 +00:00
Adrian Chadd
7fbdd9a0e9 Add another HAL function which waits for a register for a configurable amount.
This will be used by some future code.
2011-01-20 07:03:20 +00:00
Adrian Chadd
9ea467445d Add a new HAL method to retrieve the completion schedule. It sets
the completion schedule from the hardware and returns AH_TRUE if
the hardware supports multi-rate retries (AR5212 and above); and
returns AH_FALSE if the hardware doesn't support multi-rate retries.

The sample rate module directly reads the TX completion descriptor
and extracts the TX schedule information from that. It will be
updated in a future commit to instead use this method to determine
the completion schedule.
2011-01-20 05:49:15 +00:00
Oleksandr Tymoshenko
eb46a7a590 Fix build by changing format for size_t to %jd 2011-01-20 05:44:36 +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
cbc134ad03 Introduce signed and unsigned version of CTLTYPE_QUAD, renaming
existing uses.  Rename sysctl_handle_quad() to sysctl_handle_64().
2011-01-19 23:00:25 +00:00
Juli Mallett
d917717eeb The output format should be determined by the ABI flags, not the ldscript.
This ldscript is used with both little-endian and big-endian targets.

This hopefully fixes MIPS universe.

NB: We really should get rid of almost all of the MIPS ldscripts.  There's
    only gratuitous differences between them, mostly because they're too
    specific or they do things like specify the output format rather than
    taking it from flags given in the kernel config file or the default
    output format of the compiler.

Also add svn:keywords property.
2011-01-19 22:15:12 +00:00
Michael Tuexen
0e9a9c104e Cleanup the management of CC functions.
MFC after: 3 months.
2011-01-19 22:10:35 +00:00
Juli Mallett
166bee2858 Fix format of physical addresses; this fixes the n32 build. 2011-01-19 21:45:40 +00:00
Konstantin Belousov
de64ee1a30 Use CTLFLAG_RDTUN for read-only sysctl that exports tunable.
Reminded by:	pjd
MFC after:	6 days
2011-01-19 21:35:48 +00:00
Randall Stewart
c3f9cbb0e1 Fix style 9 nit that snuck in when I
grabbed the wrong patch ;-0 (thanks Daniel)

MFC after:	1 week
2011-01-19 20:57:08 +00:00
John Baldwin
a2add8d070 Fix build with KDB defined.
Pointy hat to:	jhb
Submitted by:	jkim
2011-01-19 19:49:48 +00:00
Jack F Vogel
182b3808b5 Update driver to version 2.3.8:
CRITICAL FIX - with stats changes the older 82598 will panic
	and trash the stack on driver load, FCOE registers ONLY exist
	in 82599 and must not be read otherwise.

	kern/153951 - to correct incorrect media type on adapters
	with pluggable modules I have eliminated the old static
	table in favor of a new dynamic shared code routine. This
	also has the benefit of detecting changes when a different
	module is inserted.

	Performance/enhancement to the Flow Director code from my
	linux coworker (the developer of the code).

	Fixes from Michael Tuexen - a data corruption problem on the
	82599 (CRITICAL), fix so the buf size correctly adjusts as
	the cluster changes, and max descriptors are set properly.
	Also added 16K clusters for those REALLY big jumbos :)

	In the RX path, the RX LOCK was not being released, and this
	causes LOR problems. Add the code that igb already has.

	Sync with in house shared code, this was necessary for the
	Flow Director fix.

MFC in 2 days
2011-01-19 19:36:27 +00:00
Randall Stewart
a38b1c8c5e Fix a bug where Multicast packets sent from a
udp endpoint may end up echoing back to the sender
even with OUT joining the multi-cast group.

Reviewed by:	gnn, bms, bz?
Obtained from:	deischen (with help from)
2011-01-19 19:07:16 +00:00
Jack F Vogel
fbfbce8ae9 Fix for kern/152853, pullup at the wrong point
is breaking UDP. Thanks to Petr Lampa for the
patch.
2011-01-19 18:20:11 +00:00
Bernhard Schmidt
d3befdecdf Jump to the next element and not to an arbitrary point. frm[1] contains
the element's data length, frm[2] is the first byte of the element's data.

Submitted by:	Monthadar Al Jaberi <monthadar at gmail.com>
MFC after:	1 week
2011-01-19 17:40:58 +00:00
Edward Tomasz Napierala
7a93bf9a69 Add MNT_NFS4ACLS to ZFS mount flags. It's not conditional, since there
is no way to disable NFSv4 ACLs in ZFS.  This should make it easier
for the NFS server to figure out whether the exported filesystem supports
ACLs or not.

Reviewed by:	pjd
MFC after:	2 weeks
2011-01-19 17:11:52 +00:00
Jung-uk Kim
fd240d6d9f Fix yet another fallout from r208833. VM86 BIOS call may cause page fault
when FPU is in use.

Reported by:	Marc UBM Bocklet (ubm dot freebsd at googlemail dot com)
Tested by:	b. f. (bf1783 at googlemail dot com)
MFC after:	3 days
2011-01-19 17:09:07 +00:00
Matthew D Fleming
f8e4b4ef49 sysctl(8) should use the CTLTYPE to determine the type of data when
reading.  (This was already done for writing to a sysctl).  This
requires all SYSCTL setups to specify a type.  Most of them are now
checked at compile-time.

Remove SYSCTL_*X* sysctl additions as the print being in hex should be
controlled by the -x flag to sysctl(8).

Succested by:	bde
2011-01-19 17:04:07 +00:00
John Baldwin
08b1d53573 Whitespace and style fixes. 2011-01-19 16:55:32 +00:00
John Baldwin
f82a066c72 Move calculation of 'bmask' earlier to match it's current location in
ufs_lookup().
2011-01-19 16:52:22 +00:00
Konstantin Belousov
007777f137 Add missed ().
Noted by:	alc
MFC after:	3 days
2011-01-19 16:48:07 +00:00
John Baldwin
007c620744 Merge 118969 from UFS:
Eliminate the i_devvp field from the incore inodes, we can get the same
value from ip->i_ump->um_devvp.

Submitted by:	Pedro F. Giffuni  giffunip at yahoo
MFC after:	1 week
2011-01-19 16:46:13 +00:00
Alan Cox
18a22f96e0 There is no point in calling vm_object_set_writeable_dirty() on an object
that is definitively known to be swap backed since its only effects are on
vnode-backed objects.

Reviewed by:	kib
2011-01-19 15:43:54 +00:00
Konstantin Belousov
e225428f27 In linuxolator getdents_common(), it seems there is no reason to loop
if no records where returned by VOP_READDIR(). Readdir implementations
allowed to return 0 records when first record is larger then supplied
buffer. In this case trying to execute VOP_READDIR() again causes the
syscall looping forewer.

The goto was there from the day 1, which goes back to 1995 year.

Reported and tested by:	Beat G?tzi <beat chruetertee ch>
MFC after:   2 weeks
2011-01-19 12:19:25 +00:00
Juli Mallett
2a05a35c57 Don't do a device_identify to add uart0, it's already hinted.
Reported by:	imp
2011-01-19 07:06:28 +00:00
Matthew D Fleming
f4f04709ac Fix a few more SYSCTL_PROC() that were missing a CTLFLAG type specifier. 2011-01-19 00:57:58 +00:00
Konstantin Belousov
9e52b8b629 Make the length of the LDT a loader tunable, machdep.max_ldt_segment,
and export it with read-only sysctl. Remove unused defines.

Reviewed by:	jhb (previous version)
MFC after:	1 week
2011-01-18 23:00:22 +00:00
Konstantin Belousov
a05c98a099 Use malloc(9) instead of kmem_alloc(9) for temporal copy of the
user-supplied descriptor array.

Noted and reviewed by:	jhb (previous version)
MFC after:	1 week
2011-01-18 22:56:10 +00:00
Konstantin Belousov
55aabb7fd1 For architectures not using direct map , and requiring real KVA page for
sf buf allocation, use wakeup() instead of wakeup_one() to notify sf
buffer waiters about free buffer.

sf_buf_alloc() calls msleep(PCATCH) when SFB_CATCH flag was given,
and for simultaneous wakeup and signal delivery, msleep() returns
EINTR/ERESTART despite the thread was selected for wakeup_one(). As
result, we loose a wakeup, and some other waiter will not be woken up.

Reported and tested by:	az
Reviewed by:	alc, jhb
MFC after:	1 week
2011-01-18 21:57:02 +00:00
Andreas Tobler
14be64618e There are PowerMacs which do not have a hwsensor-location property
for this sensor. Instead of leaving this location empty we use here
the default name 'sensor'.

Submitted by: Justin Hibbits <chmeeedalf at gmail dot com>
Approved by: nwhitehorn (mentor)
2011-01-18 21:47:30 +00:00
Hans Petter Selasky
8be0933446 Make USB packet filtering code optional.
Approved by:	thompsa (mentor)
2011-01-18 21:18:51 +00:00
Matthew D Fleming
5bc0787f29 Specify a CTLTYPE_FOO so that a future sysctl(8) change does not need
to rely on the format string.
2011-01-18 21:14:23 +00:00
Matthew D Fleming
2fee06f087 Specify a CTLTYPE_FOO so that a future sysctl(8) change does not need
to rely on the format string.
2011-01-18 21:14:18 +00:00
Matthew D Fleming
79c3d51b86 Specify a CTLTYPE_FOO so that a future sysctl(8) change does not need
to rely on the format string.  For SYSCTL_PROC instances that I
noticed a discrepancy between the CTLTYPE and the format specifier,
fix the CTLTYPE.
2011-01-18 21:14:13 +00:00
Pyun YongHyeon
ed15702f7e Rework RX filter programming by providing separate handler for
DP8381[56] and SiS 900/7016 controllers.  After r212119, sis(4) no
longer reinitializes controller if ALLMULTI/PROMISC was changed.
However, RX filter handling code assumed some bits of the RX filter
is programmed by driver initialization. This caused ALLMULTI/PROMISC
configuration is ignored under certain conditions.
Fix that issue by reprogramming all bits of RX filter register.
While I'm here follow recommended RX filter programming steps
recommended by National DP8381[56] data sheet(RX filter should be
is disabled before programming).

Reported by:	Paul Schenkeveld < freebsd () psconsult dot nl >
Tested by:	Paul Schenkeveld < freebsd () psconsult dot nl >
MFC after:	3 days
2011-01-18 17:50:14 +00:00
John Baldwin
6bd823f334 - Remove some always-true checks (checking for unsigned < 0).
- Only check largs->num against max_ldt_segment on amd64 for I386_SET_LDT
  when descriptors are provided.  Specifically, allow the 'start == 0'
  and 'num == 0' special case used to free all LDT entries that previously
  failed with EINVAL.

Submitted by:	clang via rdivacky (some of 1)
Reviewed by:	kib
2011-01-18 16:43:01 +00:00
John Baldwin
287e0d97bf Fix some bugs in my last set of changes to ale(4):
- Remove extra unlock from end of ale_start_locked().
- Expand scope of locking in interrupt handler.
- Move ether_ifdetach() earlier and retire now-unneeded DETACH flag.

Tested by:	Aryeh Friedman
Reviewed by:	yongari (earlier version)
2011-01-18 16:27:40 +00:00
Yoshihiro Takahashi
2e56cd38cb MFi386: revision 217515
The mem_range_softc is defined in mem.c.
2011-01-18 15:35:13 +00:00
John Baldwin
f0c734d5e3 Remove some always-true comparisons.
Submitted by:	clang via rdivacky
2011-01-18 15:23:16 +00:00
John Baldwin
4a26285ea1 Remove bogus check. pcib_get_bus() (like other BUS_ACCESSOR() methods)
doesn't "fail", it may merely return garbage if it is not a valid ivar
for a given device.  Our parent device must be a 'pcib' device, so we
can just assume it implements pcib IVARs, and all pcib devices have a
bus number.

Submitted by:	clang via rdivacky
2011-01-18 14:58:44 +00:00
Rick Macklem
8207db3ec3 Fix the experimental NFSv4 server so that it uses VOP_ACCESSX()
to check for VREAD_ACL instead of VOP_ACCESS().

MFC after:	3 days
2011-01-18 14:34:45 +00:00
Andrey V. Elsukov
799eac8c3d Limit maximum number of GPT entries to 4k. It is most realistic value
and can prevent kernel memory exhausting when big value is specified
from command line.

Split reading and writing operation to several iteration to do not
trigger KASSERT when data length is greater than MAXPHYS.

PR:             kern/144962, kern/147851
MFC after:      2 weeks
2011-01-18 09:52:53 +00:00
Alan Cox
2c4992db70 Move the definition of M_VMPGDATA to the swap pager, where the only
remaining uses are.
2011-01-18 04:54:43 +00:00
Pyun YongHyeon
ef278cb4ae Change model names of controller RTL_HWREV_8168_SPIN[123] to real ones.
s/RL_HWREV_8168_SPIN1/RL_HWREV_8168B_SPIN1/g
s/RL_HWREV_8168_SPIN2/RL_HWREV_8168B_SPIN2/g
s/RL_HWREV_8168_SPIN3/RL_HWREV_8168B_SPIN3/g
No functional changes.
2011-01-18 00:46:10 +00:00
Marcel Moolenaar
e3d4100642 Support booting non FDT-capable loaders:
1.  Allow embedding the FDT into the kernel, just like PowerPC/book-E.
2.  If the loader passes us a pointer to the bootinfo structure, save
    it and use it to fill in the gaps (e.g. bus frequencies, etc).
2011-01-17 23:54:50 +00:00
Marcel Moolenaar
3470949a74 Check the environment for system devices before using the FDT.
This allows overriding the FDT, and allows specifying a debug
port.
2011-01-17 23:34:36 +00:00
Jung-uk Kim
bc35e60ec0 Remove empty dev_mem_md_init() stubs. 2011-01-17 23:06:47 +00:00
Warner Losh
f381c26847 Save the CPU model, the board and the CPU clock rate so they are reported by
the approrpiate sysctl.
2011-01-17 23:03:09 +00:00
Warner Losh
5d8f773b87 Kill redundant cpu line 2011-01-17 23:00:23 +00:00
Warner Losh
b54e5c906c Make cpu_model public (otherwise there's no way to set it) and bump it
to 80 characters.
Add hw.board to export board information, if known, from the mips kernel.
2011-01-17 22:58:41 +00:00
Jung-uk Kim
2fea643112 Add reader/writer lock around mem_range_attr_get() and mem_range_attr_set().
Compile sys/dev/mem/memutil.c for all supported platforms and remove now
unnecessary dev_mem_md_init().  Consistently define mem_range_softc from
mem.c for all platforms.  Add missing #include guards for machine/memdev.h
and sys/memrange.h.  Clean up some nearby style(9) nits.

MFC after:	1 month
2011-01-17 22:58:28 +00:00
Marius Strobl
db3a488fb0 In order to save instructions the MMU trap handlers assumed that the kernel
TSB is located within the 32-bit address space, which held true as long as
we were using virtual addresses magic-mapped before the location of the
kernel for addressing it. However, with r216803 in place when possible we
address it via its physical address instead, which on machines like Sun Fire
V880 have no physical memory in the 32-bit address space at all requires
to use 64-bit addressing. When using physical addressing it still should
be safe to assume that we can just ignore the lowest 10 bits of the address
as a minor optimization as we did before r216803.
2011-01-17 20:32:17 +00:00
Bernhard Schmidt
bd56e71b4b Pull ieee80211_ratectl_node_init() calls from drivers into net80211.
This fixes hostap mode for at least ral(4) and run(4), because there is
no sufficient call into drivers which could be used initialize the node
related ratectl variables.

MFC after:	3 days
2011-01-17 20:15:15 +00:00
Alexander Motin
8b09b5b170 Fix 32bit bit fields handling. This fixes card serial number fetching.
It was just a cosmetic issue, because that number is only reported in logs.

Reported by:	Michael Butler on current@
2011-01-17 19:31:34 +00:00
Alan Cox
44e46b9e53 Explicitly initialize the page's queue field to PQ_NONE instead of relying
on PQ_NONE being zero.

Redefine PQ_NONE and PQ_COUNT so that a page queue isn't allocated for
PQ_NONE.

Reviewed by:	kib@
2011-01-17 19:17:26 +00:00
Jung-uk Kim
df74996c3d Avoid preemption while manipulating CRs and MTRRs.
Tested by:	ariff
2011-01-17 17:30:35 +00:00
Pyun YongHyeon
81eee0ebf8 Implement initial jumbo frame support for RTL8168/8111 C/D/E PCIe
GbE controllers. It seems these controllers no longer support
multi-fragmented RX buffers such that driver have to allocate
physically contiguous buffers.

 o Retire RL_FLAG_NOJUMBO flag and introduce RL_FLAG_JUMBOV2 to
   mark controllers that use new jumbo frame scheme.
 o Configure PCIe max read request size to 4096 for standard frames
   and reduce it to 512 for jumbo frames.
 o TSO/checksum offloading is not supported for jumbo frames on
   these controllers. Reflect it to ioctl handler and driver
   initialization.
 o Remove unused rl_stats_no_timeout in softc.
 o Embed a pointer to structure rl_hwrev into softc to keep track
   of controller MTU limitation and remove rl_hwrev in softc since
   that information is available through a pointer to structure
   rl_hwrev.

Special thanks to Realtek for donating sample hardwares which made
this possible.

H/W donated by:	Realtek Semiconductor Corp.
2011-01-17 03:24:33 +00:00
Pyun YongHyeon
f0431c5bb0 Add initial support for RTL8168E/8111E-VL PCIe GbE.
H/W donated by:	Realtek Semiconductor Corp.
2011-01-17 02:23:50 +00:00
Alan Cox
9454f82862 Sort function prototypes. 2011-01-16 20:40:50 +00:00
Alan Cox
43319c116a Update a lock annotation on the page structure. 2011-01-16 18:04:01 +00:00
Alan Cox
4c6a2e7a1f Shift responsibility for synchronizing access to the page's act_count
field to the object's lock.

Reviewed by:	kib@
2011-01-16 18:01:39 +00:00
Alan Cox
9648f3447d Clean up the start of vm_page_alloc(). In particular, eliminate an
assertion that is no longer required.  Long ago, calls to vm_page_alloc()
from an interrupt handler had to specify VM_ALLOC_INTERRUPT so that
vm_page_alloc() would not attempt to reclaim a PQ_CACHE page from another vm
object.  Today, with the synchronization on a vm object's collection of
PQ_CACHE pages, this is no longer an issue.  In fact, VM_ALLOC_INTERRUPT now
reclaims PQ_CACHE pages just like VM_ALLOC_{NORMAL,SYSTEM}.

MFC after:	3 weeks
2011-01-16 17:33:34 +00:00
Michael Tuexen
ea8345d6a7 Add support for resource pooling to CMT.
An original version of the patch was developed by Martin Becke
and Thomas Dreibholz.

MFC after: 3 months
2011-01-16 10:02:46 +00:00
Konstantin Belousov
c6c9025b65 For consistency, use kernel_object instead of &kernel_object_store
when initializing the object mutex. Do the same for kmem_object.

Discussed with:	alc
MFC after:	1 week
2011-01-15 21:56:38 +00:00
Marcel Moolenaar
951f1334b6 Don't redefine MODINFOMD_BOOTINFO as MODINFOMD_DTBP. This
breaks support for older loaders. Add MODINFOMD_DTBP as
a new tag instead.
2011-01-15 20:18:08 +00:00
Alan Cox
ff5958e785 For some time now, the kernel and kmem objects have been ordinary
OBJT_PHYS objects.  Thus, there is no need for handling them specially
in vm_fault().  In fact, this special case handling would have led to
an assertion failure just before the call to pmap_enter().

Reviewed by:	kib@
MFC after:	6 weeks
2011-01-15 19:21:28 +00:00
Andreas Tobler
b919d343a9 Remove unused variable. Spotted by a cppcheck
(devel/cppcheck, http://sourceforge.net/projects/cppcheck) run.

Approved by: nwhitehorn (mentor)
2011-01-15 19:16:56 +00:00
Andreas Tobler
49ffb2cf8c Remove unused variables. Spotted by a cppcheck
(devel/cppcheck, http://sourceforge.net/projects/cppcheck) run.

Approved by: nwhitehorn (mentor)
2011-01-15 19:16:05 +00:00
Alexander Motin
26bdaeddd8 Some old WD SATA disks report supported and enabled device-initiated
interface power management, but return ABORT error on attempt to disable
it. Make CAM SATA probe sequence ignore this error, as it is not fatal.
2011-01-15 09:43:25 +00:00
Rick Macklem
5f73287a6e Modify the experimental NFSv4 server so that it posts a SIGUSR2
signal to the master nfsd daemon whenever the stable restart
file has been modified. This will allow the master nfsd daemon
to maintain an up to date backup copy of the file. This is
enabled via the nfssvc() syscall, so that older nfsd daemons
will not be signaled.

Reviewed by:	jhb
MFC after:	1 week
2011-01-14 23:30:35 +00:00
Jung-uk Kim
bdbf2db5b2 Remove redundant, bogus, and even harmful uses of setting TS bit in CR0.
It is done from fpstate_drop() when it is really necessary.

Reviewed by:	kib
MFC after:	1 week
2011-01-14 21:09:01 +00:00
Marius Strobl
c6397d3f0e - Even after masking the media with IFM_GMASK the result may have bits
besides the duplex ones set so just comparing it with IFM_FDX may lead
  to false negatives.
- Just let the default case handle all unsupported media types.
- In pnphy_status() don't unnecessarily read a register twice.
- Remove unnused macros.

MFC after:	1 week
2011-01-14 20:26:59 +00:00
Marius Strobl
39bb2e5288 - Allow IFM_FLAG0 to be set indicating that auto-negotiation with manual
configuration, which is used to work around issues with certain setups
  (see r161237) by default, should not be triggered as it may in turn
  cause harm in some edge cases.
- Even after masking the media with IFM_GMASK the result may have bits
  besides the duplex ones set so just comparing it with IFM_FDX may lead
  to false negatives.
- Announce PAUSE support also for manually selected 1000BASE-T, but for
  all manually selected media types only in full-duplex mode. Announce
  asymmetric PAUSE support only for manually selected 1000BASE-T.
- Simplify setting the manual configuration bits to only once after we
  have figured them all out. This also means we no longer unnecessarily
  update the hardware along the road.
- Remove a stale comment.

Reviewed by:	yongari (plus additional testing)
MFC after:	3 days
2011-01-14 19:39:12 +00:00
Marius Strobl
5c39059aaf - Don't announce PAUSE support for half-duplex when MIIF_FORCEPAUSE is
set.
- Let mii_phy_auto() also announce PAUSE support for 10baseT-FDX.

MFC after:	1 week
2011-01-14 19:33:58 +00:00
Marius Strobl
87a303dc63 - Even after masking the media with IFM_GMASK the result may have bits
besides the duplex ones set so just comparing it with IFM_FDX may lead
  to false negatives.
- Simplify ciphy_service() to only set the manual configuration bits
  once after we have figured them all out. This also means we no longer
  unnecessarily update the hardware along the road.

MFC after:	1 week
2011-01-14 19:29:53 +00:00
Marius Strobl
34259ba39b - Masking IFM_GMASK when also masking IFM_FDX is redundant and just
complicates the code.
- Don't let atphy_setmedia() announce PAUSE support for half-duplex when
  MIIF_FORCEPAUSE is set.
- Simplify e1000phy_service() and ip1000phy_service() to only set the
  manual configuration bits once after we have figured them all out. For
  ip1000phy_service() this also means we no longer unnecessarily update
  the hardware along the road.

MFC after:	1 week
2011-01-14 19:16:59 +00:00
John Baldwin
2dc29adb9f Rework realtime priority support:
- Move the realtime priority range up above kernel sleep priorities and
  just below interrupt thread priorities.
- Contract the interrupt and kernel sleep priority ranges a bit so that
  the timesharing priority band can be increased.  The new timeshare range
  is now slightly larger than the old realtime + timeshare ranges.
- Change the ULE scheduler to no longer use realtime priorities for
  interactive threads.  Instead, the larger timeshare range is now split
  into separate subranges for interactive and non-interactive ("batch")
  threads.  The end result is that interactive threads and non-interactive
  threads still use the same priority ranges as before, but realtime
  threads now have a separate, dedicated priority range.
- Do not modify the priority of non-timeshare threads in sched_sleep()
  or via cv_broadcastpri().  Realtime and idle priority threads will
  no longer have their priorities affected by sleeping in the kernel.

Reviewed by:	jeff
2011-01-14 17:06:54 +00:00
Konstantin Belousov
640c77e126 Enable shared page for the signal trampolines on PowerPC.
Reviewed and tested by:	nwhitehorn
2011-01-14 11:36:44 +00:00
Christian S.J. Peron
6627ad29b4 Correct bogus initialization. It should be noted that this change
has been corrected in the vendor branch, but for now, silence clang
warnings.

Found by:	clang
Discussed with:	mlaier
MFC after:	1 week
2011-01-14 04:24:53 +00:00
Pyun YongHyeon
4a814a5edb If driver is not able to allocate RX buffer, do not start driver.
While I'm here move RX buffer allocation and descriptor
initialization up to not touch hardware registers in case of RX
buffer allocation failure.
2011-01-13 23:15:09 +00:00
Pyun YongHyeon
9e18005d99 Make sure to check validity of dma maps before destroying. 2011-01-13 23:00:28 +00:00
Pyun YongHyeon
9325262669 re_reset() should be called only after setting device specific
features.
2011-01-13 22:52:57 +00:00
Pyun YongHyeon
d3b181ae81 Allow TX/RX checksum offloading to be configured independently. 2011-01-13 22:49:10 +00:00
John Baldwin
3b33d63074 - Move ether_ifdetach() earlier and remove now-unneeded IN_DETACH flag.
- Expand locking in interrupt handler.

Reviewed by:	yongari
2011-01-13 21:49:14 +00:00
Hans Petter Selasky
c1338c65d6 - Add support for 64-byte contexts to XHCI driver.
- Remove some dead code.
- Fixed one instance of missing endian conversion.

Approved by:	thompsa (mentor)
2011-01-13 20:03:55 +00:00