Commit Graph

74978 Commits

Author SHA1 Message Date
Alexander Motin
ea35d583e8 MFC r203386:
Change the way in which fake async events generated. Do not use
taskqueue for lock decoupling, as it causes unwanted races.
2010-02-14 19:48:53 +00:00
Alexander Motin
31d3ea037e MFC r203385:
- Use separate buffer for identify data fetching. We can't use main buffer
here if device already running, as data need to be formatted before use.
- Remove some saved_ccb variables. They are unused now.
2010-02-14 19:46:54 +00:00
Alexander Motin
929100472e MFC r203376, r203384:
- Give ATA/SATA SIMs info about ATAPI packet size, supported by device.
- Make ATA XPT to reject longer SCSI CDBs then supported by device, or
any SCSI CDBs, if device doesn't support ATAPI.
2010-02-14 19:44:48 +00:00
Alexander Motin
50ae5fde8d MFC r203108:
Large set of CAM improvements:
- Unify bus reset/probe sequence. Whenever bus attached at boot or later,
CAM will automatically reset and scan it. It allows to remove duplicate
code from many drivers.
- Any bus, attached before CAM completed it's boot-time initialization,
will equally join to the process, delaying boot if needed.
- New kern.cam.boot_delay loader tunable should help controllers that
are still unable to register their buses in time (such as slow USB/
PCCard/ CardBus devices), by adding one more event to wait on boot.
- To allow synchronization between different CAM levels, concept of
requests priorities was extended. Priorities now split between several
"run levels". Device can be freezed at specified level, allowing higher
priority requests to pass. For example, no payload requests allowed,
until PMP driver enable port. ATA XPT negotiate transfer parameters,
periph driver configure caching and so on.
- Frozen requests are no more counted by request allocation scheduler.
It fixes deadlocks, when frozen low priority payload requests occupying
slots, required by higher levels to manage theit execution.
- Two last changes were holding proper ATA reinitialization and error
recovery implementation. Now it is done: SATA controllers and Port
Multipliers now implement automatic hot-plug and should correctly
recover from timeouts and bus resets.
- Improve SCSI error recovery for devices on buses without automatic sense
reporting, such as ATAPI or USB. For example, it allows CAM to wait, while
CD drive loads disk, instead of immediately return error status.
- Decapitalize diagnostic messages and make them more readable and sensible.
- Teach PMP driver to limit maximum speed on fan-out ports.
- Make boot wait for PMP scan completes, and make rescan more reliable.
- Fix pass driver, to return CCB to user level in case of error.
- Increase number of retries in cd driver, as device may return several UAs.
2010-02-14 19:38:27 +00:00
Alexander Motin
9290c85988 MFC r203030:
Add support for SATA part of Marvell 88SE912x controllers to ahci(4).
Limit early revisions from 6Gb/s to 3Gb/s by default, or they negotiate
only 1.5Gb/s, when 3Gb/s devices connected.

Add dummy driver for PATA part of these controllers, preventing generic
driver attach them. It causes system freeze when SATA controller used after
PATA was touched.
2010-02-14 19:28:45 +00:00
Alexander Motin
82368eed51 MFC r202699:
Make ata_getrev() an optional method by implementing ata_null_getrev().
This fixes a bogus '???' boot message on Cambria boards with a CompactFlash
card.
2010-02-14 19:23:05 +00:00
Alexander Motin
20bbf2de82 MFp4:
After last running command completed, give commands in timeout state
second time.
2010-02-14 12:24:12 +00:00
Alexander Motin
6228bcd1ee MFC r203524:
When hacking INQUIRY result, make sure that it is right INQUIRY and there
is enough of result to hack.
2010-02-14 12:04:25 +00:00
Alexander Motin
9a1be4e8d1 MFC r203489:
Return CAM_RELEASE_SIMQ flag only when it is needed, when SIM really
was frozen before and should be released.
2010-02-14 12:03:04 +00:00
Alexander Motin
66a894f383 MFC r203484:
Do not release device, when changing number of openings.
2010-02-14 12:00:23 +00:00
Alexander Motin
1ea9446171 MFC r202150, r202170:
Make OSS_GETVERSION ioctl really work. It has 'M' group, not 'P',
as different nearby ones, and was grabbed by MIXER_xxx() handler.

While there, replace '(cmd & MIXER_xxx(0)) == MIXER_xxx(0)' expressions
with more correct '(cmd & ~0xff) == MIXER_xxx(0)'. Use of bit operations
to compare numeric fields doesn't looks sane.
2010-02-14 11:53:51 +00:00
Gavin Atkinson
3390bcf4cf Merge r200530 from head:
Don't panic on failure to attach if we fail before or during the
  if_alloc() of ifp.

  This fixes the panic reported in the PRs, but not the attach failure.

PR:		kern/139079, kern/143874
Tested by:	Steven Noonan <steven uplinklabs.net>
Reviewed by:	thompsa
2010-02-14 09:34:27 +00:00
Rick Macklem
16a11310f0 MFC: r203303
Patch the experimental NFS client so that there is a timeout
for negative name cache entries in a manner analogous to
r202767 for the regular NFS client. Also, make the code in
nfs_lookup() compatible with that of the regular client
and replace the sysctl variable that enabled negative name
caching with the mount point option.
2010-02-14 00:43:42 +00:00
Matt Jacob
9090fd5bfa Pick up some changes the the MFC missed. 2010-02-12 00:47:23 +00:00
Rick Macklem
0668507346 MFC: r203119
Patch the experimental NFS client in a manner analogous to
r203072 for the regular NFS client. Also, delete two fields
of struct nfsmount that are not used by the FreeBSD port of
the client.
2010-02-11 21:25:48 +00:00
Matt Jacob
7733cf8fff MFC a number of changes from head for ISP (203478,203463,203444,202418,201758,
201408,201325,200089,198822,197373,197372,197214,196162). Since one of those
changes was a semicolon cleanup from somebody else, this touches a lot more.
2010-02-11 18:34:06 +00:00
Rick Macklem
88cf3d348f MFC: r203072
Fix a race that can occur when nfs nfsiod threads are being created.
Without this patch it was possible for a different thread that calls
nfs_asyncio() to snitch a newly created nfsiod thread that was
intended for another caller of nfs_asyncio(), because the nfs_iod_mtx
mutex was unlocked while the new nfsiod thread was created. This patch
labels the newly created nfsiod, so that it is not taken by another
caller of nfs_asyncio(). This is believed to fix the problem reported
on the freebsd-stable email list under the subject:
FreeBSD NFS client/Linux NFS server issue.

Tested by:	to DOT my DOT trociny AT gmail DOT com
Reviewed by:	jhb
2010-02-10 16:16:50 +00:00
Andriy Gapon
d5f8ba9274 MFC r203062: acpi_hpet: correctly get number of timers in a timer block 2010-02-10 09:46:31 +00:00
Marko Zec
7526c9dfc7 MFC r203483:
Instead of spamming the console on each curvnet recursion event, print
  out each such call graph only once, along with a stack backtrace.  This
  should make kernels built with VNET_DEBUG reasonably usable again in
  busy / production environments.

  Introduce a new DDB command "show vnetrcrs" which dumps the whole log
  of distinctive curvnet recursion events.  This might be useful when
  recursion reports get burried / lost too deep in the message buffer.
  In the later case stack backtraces are not available.

  Reviewed by:  bz
2010-02-10 08:50:06 +00:00
Ed Maste
207a2ae06c MFC r198593:
Rename aac_fast_intr to aac_filter to reflect its current use.  Eliminate
  the fallback of using the filter as an interrupt handler, as it is no
  longer needed.

  Discussed with:       scottl, jhb
2010-02-09 22:05:30 +00:00
Qing Li
613e96b8c6 MFC r203401
Some of the existing ppp and vpn related scripts create and set
the IP addresses of the tunnel end points to the same value. In
these cases the loopback route is not installed for the local
end.
2010-02-09 19:27:54 +00:00
Attilio Rao
95e1c1fa00 MC r202889, r202940:
- Fix a race in sched_switch() of sched_4bsd.
  Block the td_lock when acquiring explicitly sched_lock in order to prevent
  races with other td_lock contenders.
- Merge the ULE's internal function thread_block_switch() into the global
  thread_lock_block() and make the former semantic as the default for
  thread_lock_block().
- Split out an invariant in order to have better checks.
2010-02-08 14:08:52 +00:00
David Xu
d430c009c7 MFC r203414:
After busied the lock, re-read state word before checking waiters flag,
otherwise, the waiters bit may not be set and a wakeup is lost.
2010-02-08 03:11:55 +00:00
Marius Strobl
73769927ae MFC: r202900
Merge r203608 from amd64/i386:

In syscall(), reread syscall number and arguments after ptracestop(),
if debugger modified anything in the process environment.
2010-02-07 11:59:55 +00:00
Konstantin Belousov
c329abd0d3 MFC r202882:
For i386, amd64 and ia32 on amd64 MD syscall(), reread syscall number
and arguments after ptracestop(), if debugger modified anything in the
process environment.
2010-02-07 11:37:38 +00:00
Konstantin Belousov
02d65815cb MFC r202529:
vunref() the vnode in vm object deallocation code for OBJT_VNODE
appropriate number of times to prevent possible vnode reference leak.
2010-02-07 10:51:17 +00:00
Konstantin Belousov
e9560b4089 MFC r202528:
Add vunref(9).
2010-02-07 10:44:44 +00:00
Julian Elischer
2ae7ec29fd MFC of 197952 and 198075
Virtualize the pfil hooks so that different jails may chose different
    packet filters. ALso allows ipfw to be enabled on on ejail and disabled
    on another. In 8.0 it's a global setting.
and
    Unbreak the VIMAGE build with IPSEC, broken with r197952 by
    virtualizing the pfil hooks.
    For consistency add the V_ to virtualize the pfil hooks in here as well.
2010-02-07 09:00:22 +00:00
Marius Strobl
901c651d7b MFC: r203185
Implement handling of the third argument of cpu_switch().

PR:		143215
2010-02-06 17:33:39 +00:00
Andriy Gapon
bb07fbe3c1 MFC r203160: add static qualifier to definition of a static function 2010-02-06 12:17:20 +00:00
Andriy Gapon
e21bbd1743 MFC r197104,197105,197106,197107,197688,198237,199337,199338,200553,200554,
202771,202773: bring acpica version to 20100121

MFC details:
r197104 | jkim | 2009-09-12 01:48:53 +0300 (Sat, 12 Sep 2009) | 4 lines
MFV:    r196804
Import ACPICA 20090903

r197105 | jkim | 2009-09-12 01:49:34 +0300 (Sat, 12 Sep 2009) | 2 lines
Catch up with ACPICA 20090903.

r197106 | jkim | 2009-09-12 01:50:15 +0300 (Sat, 12 Sep 2009) | 2 lines
Catch up with ACPICA 20090903.

r197107 | jkim | 2009-09-12 01:56:08 +0300 (Sat, 12 Sep 2009) | 2 lines
Canonify include paths for newly added files.

r197688 | jkim | 2009-10-01 23:56:15 +0300 (Thu, 01 Oct 2009) | 4 lines
Compile ACPI debugger and disassembler for kernel modules
unconditionally.
These files will generate almost empty object files without
ACPI_DEBUG/DDB
options.  As a result, size of acpi.ko will increase slightly.

r198237 | jkim | 2009-10-19 19:12:58 +0300 (Mon, 19 Oct 2009) | 2 lines
Merge ACPICA 20091013.

r199337 | jkim | 2009-11-16 23:47:12 +0200 (Mon, 16 Nov 2009) | 2 lines
Merge ACPICA 20091112.

r199338 | jkim | 2009-11-16 23:53:56 +0200 (Mon, 16 Nov 2009) | 2 lines
Add a forgotten module Makefile change from the previous commit.

r200553 | jkim | 2009-12-15 00:24:04 +0200 (Tue, 15 Dec 2009) | 2 lines
Merge ACPICA 20091214.

r200554 | jkim | 2009-12-15 00:28:32 +0200 (Tue, 15 Dec 2009) | 3 lines
Remove _FDE quirk handling as these quirks are automatically repaired
by ACPICA layer since ACPICA 20091214.

r202771 | jkim | 2010-01-21 23:14:28 +0200 (Thu, 21 Jan 2010) | 2 lines
Merge ACPICA 20100121.

r202773 | jkim | 2010-01-21 23:31:39 +0200 (Thu, 21 Jan 2010) | 2 lines
Fix a new header inclusion.

Discussed with:		jkim, jhb
No objections from:	acpi@
2010-02-06 12:03:25 +00:00
Alexander Motin
f8451095fa MFC r203043, r203058:
Do not place fake interrupt register on chip.
Now we have better place for it.
2010-02-05 12:17:14 +00:00
Alexander Motin
3ca74a280b MFC r203034:
Restore SATA speed reporting, broken by ATA_CAM changes.
2010-02-05 12:09:43 +00:00
Alexander Motin
dc65878eb6 MFC r203033:
Clear ch->devices, if hard-reset failed.
This makes hot-plug work better.
2010-02-05 12:07:53 +00:00
Alexander Motin
981b11104a MFC r201566, r201567:
Move wakeup() out of mutex to reduce contention.
2010-02-05 11:56:12 +00:00
Alexander Motin
9185a70204 MFC r201545:
Slightly optimize XOR calculation.
2010-02-05 11:53:41 +00:00
Alexander Motin
9ab219c83f MFC r201264:
Call wakeup() only for the first request on the queue.
2010-02-05 11:52:28 +00:00
Gavin Atkinson
75cf52103d Merge r202161 from head:
Spell "Hz" correctly wherever it is user-visible.

PR:		bin/142566
Submitted by:	N.J. Mann   njm njm.me.uk
2010-02-05 08:52:51 +00:00
Alexander Motin
9eb48f44f2 MFC r202789, r202796:
- Improve tracer, to handle more cases of input-to-output monitoring
loopback.
- Use "igain" mixer control for input-to-output monitoring loopback.
- Allow AD1981HD codecs to use playback mixer. Now driver should be able to
really use it.
- Fix bug in shared muters operation.
2010-02-05 08:36:33 +00:00
Alexander Motin
24f890094e MFC r202736:
Print playback channels paths in order of their sequence numbers, not nids.
2010-02-05 08:32:07 +00:00
Rick Macklem
e3feb3a780 MFC: r202774
Fix a typo in a comment introduced by r202767.
2010-02-04 17:31:34 +00:00
Rick Macklem
89ae8d8476 MFC: r202767
Add a timeout for the negative name cache entries in the NFS client.
This avoids a bogus negative name cache entry from persisting forever
when another client creates an entry with the same name within the
same NFS server time of day clock tick. The mount option negnametimeo
can be used to override the default timeout interval on a
per-mount-point basis. Setting negnametimeo to 0 disables negative
name caching for the mount point.
I also fixed one obvious typo where args.timeo should be
args.maxgrouplist.

Submitted by:	jhb (earlier version)
Reviewed by:	jhb
2010-02-04 16:57:01 +00:00
Pyun YongHyeon
0fb14c6f0d MFC r203082:
Add initial support for RTL8103E PCIe fastethernet.

  PR:	kern/142974
2010-02-01 23:57:42 +00:00
John Baldwin
d362c2a208 MFC 203070:
Initialize the ifnet before calling mii_phy_probe() as some phy drivers
(e.g. e1000phy(4)) expect if_dname to be valid when they are probed.
2010-02-01 22:01:48 +00:00
Konstantin Belousov
546b397a1f MFC r203175:
The MAP_ENTRY_NEEDS_COPY flag belongs to protoeflags, cow variable
uses different namespace.
2010-02-01 10:45:23 +00:00
Xin LI
72c12306f9 Reduce diff against OpenSolaris - move Giant acquire/release to
zfs_znode.c.  As a side effect this also eliminates two potential
Giant leaks.

Approved by:  pjd
2010-02-01 09:29:32 +00:00
Gavin Atkinson
b8370f7d42 Merge r202931 from head:
Add support for four more nfsmb controllers, shipping on at least the
  ASUS Atom ION boards.

PR:		kern/142571
Submitted by:	oliver
Approved by:	ed (mentor, implicit)
2010-01-31 19:41:58 +00:00
Konstantin Belousov
613bd3f32b Bump __FreeBSD_version for sigpause(3) addition. 2010-01-31 18:41:00 +00:00
Konstantin Belousov
f2d58a1d9b MFC r199827:
Implement sighold, sigignore, sigpause, sigrelse, sigset functions.

MFC r200881 (by cognet):
Don't name parameters.
2010-01-31 18:38:03 +00:00
Konstantin Belousov
661f092a6d MFC r202881:
Staticise sigqueue manipulation functions used only in kern_sig.c.
2010-01-31 18:25:57 +00:00
Marius Strobl
36a153df8b MFC: r202903
On LP64 struct ifid is 64-bit aligned while struct fid is 32-bit aligned
so on architectures with strict alignment requirements we can't just simply
cast the latter to the former but need to copy it bytewise instead.

PR:		143010
2010-01-31 17:43:22 +00:00
Marius Strobl
6c8d1299a2 MFC: r203094
- Zero the MSI/MSI-X queue argument, otherwise mtx_init(9) can panic
  indicating an already initialized lock.
- Check for an empty MSI/MSI-X queue entry before asserting that we have
  received a MSI/MSI-X message in order to not panic in case of stray MSI/
  MSI-X queue interrupts which may happen in case of using an interrupt
  handler rather than a filter.
2010-01-31 17:17:24 +00:00
Shteryana Shopova
3ddba6330c MFC r202935:
While flushing the multicast filter of an interface, do not zero the relevant
ifmultiaddr structures' reference to the parent interface, unless the parent
interface is really detaching. While here, program only link layer multicast
filters to a wlan's hardware parent interface.

PR:		kern/142391, kern/142392
Reviewed by:	sam, rpaulo, bms
2010-01-31 11:30:28 +00:00
Edward Tomasz Napierala
7782c5efe8 MFC r196949:
Enable NFSv4 ACL support in ZFS.

MFC r197435:

In VOP_SETACL(9) and VOP_GETACL(9), specifying wrong ACL type should result
in EINVAL, not EOPNOTSUPP.
2010-01-31 02:11:14 +00:00
Antoine Brodin
c261b5023b MFC r202448 to stable/8:
Do not build netgraph kernel modules if WITHOUT_NETGRAPH is set in src.conf
  Submitted by:	bf
2010-01-30 15:28:14 +00:00
Antoine Brodin
e2b36efde5 MFC r201145 to stable/8:
(S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.
  Fix some wrong usages.
  Note: this does not affect generated binaries as this argument is not used.

  PR:		137213
  Submitted by:	Eygene Ryabinkin (initial version)
2010-01-30 12:11:21 +00:00
Alan Cox
6d41eae028 MFC r202894
Handle a race between pmap_kextract() and pmap_promote_pde().
2010-01-30 06:23:28 +00:00
Konstantin Belousov
c9dc5d496d MFC r202692:
Remove the signal from sigqueue before notifying the debugger for traced
process, fixing the race between resuming from stopped state and other
thread noting the old signal on the queue and acting.
2010-01-29 20:02:28 +00:00
Rui Paulo
b85fb2f79c MFC r202986:
o add more notification strings in iwn_intr_str()
  o sync with OpenBSD code

  Submitted by:	Bernhard Schmidt <bschmidt at techwires.net>
  MFC after:	3 days
2010-01-29 18:19:43 +00:00
Rui Paulo
623592e0c0 MFC r202967:
Call ieee80211_radiotap_rx, not ieee80211_radiotap_tx on sta_input()

   PR:		143163
   Submitted by:Alexander Egorenkov <egorenar at gmail.com>
2010-01-29 18:18:18 +00:00
George V. Neville-Neil
fbbbfe0ba5 MFC r196797:
Add ARP statistics to the kernel and netstat.
2010-01-28 16:48:44 +00:00
Joerg Wunsch
1f9b7387d8 Merge of r202870,202898:
Overhaul of the pcii driver:

. Properly allocate all IO space resources.  These cards scatter their
  IO addresses over a range of 0x1600 bytes, and they require an
  additional address for "special interrupt handling".

. Implement the "special interrupt handling" per the GPIB-PCIIA
  Technical Reference Manual; this was apparently not declared for the
  clone card this driver has been originally implemented for, but it
  turned out to be needed for both, an original NI brand PCII/PCIIA
  card as well as the Axiom AX5488 clone.

. Add some diagnostic messages for various resource allocation etc.
  failures during probe.

. Add some comments about the structure of the IO address space that
  is used by these cards.
2010-01-27 10:32:02 +00:00
Bjoern A. Zeeb
ce77b9149a MFC r202915:
Correct a typo.

  Submitted by: kensmith
2010-01-27 09:45:07 +00:00
Marko Zec
b83b25d7b1 MFC r201895:
Reduce recursions on curvnet and thus spamming the console with warning
  messages for kernels built with options VIMAGE and VNET_DEBUG enabled.

  Reviewed by:  bz
2010-01-25 14:17:13 +00:00
Attilio Rao
93a45f0f56 MFC r201879:
Introduce the new kernel thread called "deadlock resolver".
It is used in order to seek within the threads state and heuristically
understand if there is any deadlock happening.

In order to implement it, the sq_type in sleepqueues is mandatory and not
only compiled along with INVARIANTS option. Additively, a new sleepqueue
function, sleepq_type() is added, returning the type of the sleepqueue
linked to a wchan.
Three new sysctls are added in order to configure the thread:
debug.deadlkres.slptime_threshold
debug.deadlkres.blktime_threshold
debug.deadlkres.sleepfreq

rappresenting the thresholds for sleep and block time that will lead to
a deadlock matching (when exceeded), while the sleepfreq rappresents the
number of seconds between 2 consecutive thread runnings.
In order to enable the deadlock resolver thread recompile your kernel
with the option DEADLKRES.

Sponsored by:	Sandvine Incorporated
2010-01-25 12:05:51 +00:00
Attilio Rao
aa16019d66 MFC r201790:
- Set td_slptick to 0 when moving threads out of sleepqueues.
- Move td_slptick from u_int to int in order to follow 'ticks' signedness
  and wrap up accordingly.

Sponsored by:	Sandvine Incorporated
2010-01-25 11:56:53 +00:00
Michael Tuexen
b93b253dc6 MFC 202449:
Get rid of support of an old version of the SCTP-AUTH draft.
Get rid of unused MD5 code.
2010-01-24 22:17:08 +00:00
Gavin Atkinson
7ac856b829 Merge r202000 from head:
Don't panic on attach if we can't allocate ifp

Approved by:	ed (mentor, implicit)
2010-01-24 22:01:04 +00:00
Konstantin Belousov
2af4053ea7 Bump __FreeBSD_version for scandir(3) and alphasort(3) interface changes. 2010-01-24 12:37:30 +00:00
Bjoern A. Zeeb
be6797dde8 MFC r202469:
Garbage collect references to the no longer implemented tcp_fasttimo().
2010-01-24 12:22:38 +00:00
Max Khon
3dd81e0306 MFC: Send link state change control messages to "orphans" hook as well. 2010-01-24 08:59:33 +00:00
Bjoern A. Zeeb
3bcceea40e MFC r202468:
Add ip4.saddrsel/ip4.nosaddrsel (and equivalent for ip6) to control
  whether to use source address selection (default) or the primary
  jail address for unbound outgoing connections.

  This is intended to be used by people upgrading from single-IP
  jails to multi-IP jails but not having to change firewall rules,
  application ACLs, ... but to force their connections (unless
  otherwise changed) to the primry jail IP they had been used for
  years, as well as for people prefering to implement similar policies.

  Note that for IPv6, if configured incorrectly, this might lead to
  scope violations, which single-IPv6 jails could as well, as by the
  design of jails. [1]

  Reviewed by:		jamie, hrs (ipv6 part)
  Pointed out by:	hrs [1]
2010-01-23 16:40:35 +00:00
Robert Noland
c79d8f1fb5 MFC r200764
Fix a handful of issues with via agp support.

  * Read the pci capability register to identify AGP 3 support
  * Add missing smaller aperture sizes for AGP3 chips.
  * Fix the aperture size calculation on AGP2 chips.
    All sizes between 32M and 256M reported as 256M.
  * Add \n to error string.
2010-01-23 16:29:04 +00:00
Navdeep Parhar
c78cb5e4f1 MFC r202863
Don't forget to release the adapter lock for a no-op.
2010-01-23 08:37:04 +00:00
Marcel Moolenaar
5a183eb8e4 MFC rev 202552:
Add command-line option -dev to set the default value of the currdev
variable.
2010-01-23 06:29:34 +00:00
Xin LI
11ad45c9ce MFC r202268:
o Add PCI ID for BCM 5756.
 o Don't enable BGE_FLAG_BER_BUG on both 5722 and 5756, and based
   on their PCI IDs rather than their chip IDs.

Reported by:    several PC-BSD users via kmoore
Reviewed by:    yongari, imp, jhb, davidch
Sponsored by:   iXsystems, Inc.
2010-01-23 01:25:09 +00:00
Xin LI
bd277cec42 MFC r200930:
Adapt OpenBSD pf's "sloopy" TCP state machine which is useful for Direct
Server Return mode, where not all packets would be visible to the load
balancer or gateway.

This commit should be reverted when we merge future pf versions.  The
benefit it would provide is that this version does not break any existing
public interface and thus won't be a problem if we want to MFC it to
earlier FreeBSD releases.

Discussed with:	mlaier
Obtained from:	OpenBSD
Sponsored by:	iXsystems, Inc.
2010-01-23 00:32:19 +00:00
Brooks Davis
2ca586a5ac MFC r201261:
Add missing `void' keywords.
2010-01-22 20:24:55 +00:00
Brooks Davis
52c240aaf4 MFC r201350:
The devices that supported EVFILT_NETDEV kqueue filters were removed in
  r195175.  Remove all definitions, documentation, and usage.

The change of function signature for vlan_link_state() was not merged to
maintain the ABI.
2010-01-22 19:51:34 +00:00
Christian Brueffer
7468bbeaea MFC: r201848
Free allocated sbufs before returning ENOMEM.
2010-01-22 17:03:49 +00:00
Alexander Motin
320cdf733e MFC r202127, r202156:
Add multichannel (4.0, 5.1 and 7.1) playback support.

Stereo stream is no more duplicated to all ports. If you loose sound, check
you are using right connectors. Front speakers connector is usually green,
center/LFE - orange, rear - black, side - gray.
2010-01-22 11:37:19 +00:00
Alexander Motin
858bc163b7 MFC r202267:
Hide from default sndstat some information not used on daily basis,
to make it readable by average user with average screen size.
2010-01-22 11:31:49 +00:00
Alexander Motin
c6ce452791 MFC r202166:
Make default recording source choosing more intelligent.
Change default recording level from 0 to 75.
It should increase chances for things to work just out of the box.
2010-01-22 11:30:32 +00:00
Alexander Motin
d871d872fa MFC r197420:
Lock bus scan.
2010-01-22 11:16:46 +00:00
Andriy Gapon
83279a93f5 MFC r202567: acpi_ec: remove redundant acpi_disabled check 2010-01-22 09:41:09 +00:00
Andriy Gapon
773425fade MFC r202558: acpi_ec: clean up 'private' ivar when freeing memory 2010-01-22 09:34:57 +00:00
Marcel Moolenaar
a354a30d5e MFC rev. 202271-202273:
o  Add wrappers for the RT Variable Services.
o  Add ioctl requests to /dev/io on ia64 for reading and writing
   EFI variables.
2010-01-22 03:59:05 +00:00
Marcel Moolenaar
4b5ab11113 MFC rev. 202097:
Use io(4) for I/O port access on ia64, rather than through sysarch(2).
2010-01-22 03:50:43 +00:00
John Baldwin
49cc13441b MFC 198411:
- Fix several off-by-one errors when using MAXCOMLEN.  The p_comm[] and
  td_name[] arrays are actually MAXCOMLEN + 1 in size and a few places that
  created shadow copies of these arrays were just using MAXCOMLEN.
- Prefer using sizeof() of an array type to explicit constants for the
  array length in a few places.
- Ensure that all of p_comm[] and td_name[] is always zero'd during
  execve() to guard against any possible information leaks.  Previously
  trailing garbage in p_comm[] could be leaked to userland in ktrace
  record headers via td_name[].
2010-01-21 19:11:18 +00:00
John Baldwin
7b10638c5b MFC 198134,198149,198170,198171,198391,200948:
Add a facility for associating optional descriptions with active interrupt
handlers.  This is primarily intended as a way to allow devices that use
multiple interrupts (e.g. MSI) to meaningfully distinguish the various
interrupt handlers.
- Add a new BUS_DESCRIBE_INTR() method to the bus interface to associate
  a description with an active interrupt handler setup by BUS_SETUP_INTR.
  It has a default method (bus_generic_describe_intr()) which simply passes
  the request up to the parent device.
- Add a bus_describe_intr() wrapper around BUS_DESCRIBE_INTR() that supports
  printf(9) style formatting using var args.
- Reserve MAXCOMLEN bytes in the intr_handler structure to hold the name of
  an interrupt handler and copy the name passed to intr_event_add_handler()
  into that buffer instead of just saving the pointer to the name.
- Add a new intr_event_describe_handler() which appends a description string
  to an interrupt handler's name.
- Implement support for interrupt descriptions on amd64, i386, and sparc64 by
  having the nexus(4) driver supply a custom bus_describe_intr method that
  invokes a new intr_describe() MD routine which in turn looks up the
  associated interrupt event and invokes intr_event_describe_handler().
2010-01-21 17:54:29 +00:00
Marius Strobl
828c6b73ab MFC: r202587
Add epic(4) also here.
2010-01-21 17:37:25 +00:00
Christian Brueffer
4e31204f25 MFC: r202290
Build iwi(4) and iwifw(4) modules on amd64 as well.
2010-01-21 16:31:45 +00:00
John Baldwin
4b2625a76f MFC 202286:
Update the ident for the XENHVM kernel config to match the filename.
2010-01-21 15:10:20 +00:00
Navdeep Parhar
cbbe4a754c MFC r201416:
Avoid NULL dereference in arpresolve.

Requested by: kib@
2010-01-21 10:12:21 +00:00
Navdeep Parhar
e0d8d4df28 MFC r201907,202671,202678
r201907:
Extra parantheses to keep certain compilers happy.

r202671:
Fix for a cxgb(4) panic.  cxgb_ioctl can be called by the IP and IPv6
layers with non-sleepable locks held.  Don't (potentially) sleep in
those situations.

r202678:
Complain if freelist queue sizes are significantly less than desired.
2010-01-21 03:06:52 +00:00
Pyun YongHyeon
eac2bf0ee0 MFC r202406:
Don't free mbuf chains when bge(4) fails to collapse the mbuf
  chains. This part of code is to enhance performance so failing the
  collapsing should not free TX frames. Otherwise bge(4) will
  unnecessarily drop frames which in turn can freeze the network
  connection.

  Reported by:	Igor Sysoev (is <> rambler-co dot ru)
  Tested by:	Igor Sysoev (is <> rambler-co dot ru)
2010-01-21 00:53:00 +00:00
Pyun YongHyeon
85f51ebea9 MFC r202294:
Add check for fiber mode for BCM5714 PHY. This PHY supports both
  copper and fiber interfaces over GMII so an explicit check is
  necessary to know whether it was configured for fiber interface.
  This change make BCM5715S work.

  Tested by:	olli
  PR:	kern/122551
2010-01-21 00:49:14 +00:00
Pyun YongHyeon
29a6686087 MFC r202293:
For controllers that has dual mode PHY(copper or fiber) interfaces
  over GMII, make sure to enable GMII. With this change brgphy(4) is
  used to handle the dual mode PHY. Since we still don't have a sane
  way to pass PHY specific information to mii(4) layer special
  handling is needed in brgphy(4) to determine which mode of PHY was
  configured in parent interface.
  This change make BCM5715S work.

  Tested by:	olli
  Obtained from:	OpenBSD
  PR:	kern/122551
2010-01-21 00:45:12 +00:00
Pyun YongHyeon
d92c7395bf MFC r202269:
Add BCM5754 PHY id that is found on Dell Studio XPS 16.
2010-01-21 00:37:14 +00:00
Nathan Whitehorn
75a2f19f20 MFC r200018:
Bump limits on PowerPC. This allows large executables like parts of LLVM
to function.

Reviewed by:	grehan
Obtained from:	NetBSD
2010-01-20 16:28:39 +00:00
Konstantin Belousov
dc657f6117 MFC r198429, r198439, r198468, r201209, r201822, r201882:
Syncronize iwn(4) driver in stable/8 with HEAD.

Approved by:	rpaulo
2010-01-20 15:22:34 +00:00
Xin LI
b1ebb318cb MFC r201690:
Space cleanup for revision 202669 committed separately for easier review.
This commit is purely space changes.

Submitted by:	Matt Reimer
Sponsored by:	VPOP Technologies, Inc.
2010-01-20 01:14:54 +00:00
Xin LI
ac07939f0e MFC r201689:
Instead of assuming all vdevs are healthy, check the newest vdev label
for each vdev's status.  Booting from a degraded vdev should now be
more robust.

Submitted by:	Matt Reimer <mattjreimer at gmail.com>
Sponsored by:	VPOP Technologies, Inc.
2010-01-20 01:13:52 +00:00
Alexander Motin
6c35bbee61 MFC r201222:
Usually these controllers are able to automatically decode command code to
get required command protocol. But they have no idea about new commands,
such as DATA SET MANAGEMENT (TRIM). As soon as this info any way provided
by CAM, give controller specific instructions.
2010-01-19 13:36:12 +00:00
Alexander Motin
f288580266 MFC r200814:
Clear all ports interrupt status bits in single write. Clearing one by one
causes additional MSIs messages sent if several ports asked for attention
same time. Time window before clearing is not important, as these interrupts
are level triggered by interrupt source.
2010-01-19 13:33:31 +00:00
Alexander Motin
89dbf1bfd5 MFC r201993:
Report which of IXP700 legacy ATA channels are SATA.
2010-01-19 13:27:54 +00:00
Alexander Motin
4c75a1d302 MFC r200857:
Add support for Intel SCH PATA controller.

PR:             kern/140251
2010-01-19 13:26:45 +00:00
Alexander Motin
44f39e7d59 MFC r200817:
Spell AMD properly.
2010-01-19 13:25:31 +00:00
Alexander Motin
f59a7ba7ba MFC r200754:
Add VIA CX700/VX800 chipsets SATA/PATA support.

PR:             kern/121521
2010-01-19 13:24:11 +00:00
Alexander Motin
1c2e876f53 MFC r200753:
Fairly set master/slave shared PIO/WDMA timings on ITE 821x controllers.
Previous implementation could only limit mode, but not rise it back.
2010-01-19 13:21:25 +00:00
Alexander Motin
928e4114fe MFC r200655:
Serverworks OSB4 has no 0x4a (piomode) register, do not touch it.
Also OSB4 has some problems with UDMA transfers, limit it to WDMA2.
2010-01-19 13:07:25 +00:00
Alexander Motin
b136f43d44 MFC r201990:
- Report SATA in legacy emulation mode still as SATA.
- Make ATA XPT able to handle such case.
2010-01-19 13:00:33 +00:00
Alexander Motin
92d8dadcf8 MFC r201139:
Add BIO_DELETE support to ada(4):
- For SSDs use TRIM feature of DATA SET MANAGEMENT command, as defined by
ACS-2 specification working draft.
- For CompactFlash use CFA ERASE command, same as ad(4) does.

With this patch, `newfs -E /dev/ada1` was able to restore write speed of
my heavily weared OCZ Vertex SSD (firmware 1.4) up to the initial level
for the most part of it's capacity.

I have no idea whether it is normal, but for some reason it takes 200ms
to handle any TRIM command on this drive, that was making delete extremely
slow. But TRIM command is able to accept long list of LBAs and the length of
that list seems doesn't affect it's execution time. Implemented request
clusting algorithm allowed me to rise delete rate up to reasonable numbers,
when many parallel DELETE requests running.
2010-01-19 12:58:29 +00:00
Alan Cox
294a68ca62 MFC r202085
Simplify pmap_init().  Additionally, correct a harmless misbehavior on
  i386.
2010-01-18 21:17:03 +00:00
Attilio Rao
702748e988 MFC r200447,201703,201709-201710:
In current code, threads performing an interruptible sleep
will leave the waiters flag on forcing the owner to do a wakeup even
when the waiter queue is empty.
That operation may lead to a deadlock in the case of doing a fake wakeup
on the "preferred" queue while the other queue has real waiters on it,
because nobody is going to wakeup the 2nd queue waiters and they will
sleep indefinitively.
A similar bug, is present, for lockmgr in the case the waiters are
sleeping with LK_SLEEPFAIL on.

Add a sleepqueue interface which does report the actual number of waiters
on a specified queue of a waitchannel and track if at least one sleepfail
waiter is present or not. In presence of this or empty "preferred" queue,
wakeup both waiters queues.

Discussed with:	kib
Tested by:	Pete French <petefrench at ticketswitch dot com>,
		Justin Head <justin at encarnate dot com>
2010-01-18 14:43:44 +00:00
Yoshihiro Takahashi
0bd3076764 MFC: revision 201415
Re-enable more options and devices.  Now kernel size problem is gone.
2010-01-18 11:03:39 +00:00
Ed Schouten
2c9e180f34 MFC r201532:
Make TIOCSTI work again.

  It looks like I didn't implement this when I imported MPSAFE TTY.
  Applications like mail(1) still use this. I think it's conceptually bad.

  Tested by:    Pete French <petefrench ticketswitch com>
2010-01-18 09:04:53 +00:00
Xin LI
d958a7e440 MFC r202129:
Report ZFS filesystem version instead of the zpool version when we say it.

Reported by:	Yuri Pankov (on -fs@)
Submitted by:	delphij
2010-01-18 05:03:40 +00:00
Warner Losh
7578ff89fc MFC r202019:
Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms.
  # This is the resolution of removing it from DEFAULTS...
2010-01-18 00:53:21 +00:00
Rick Macklem
8c271f6707 MFC: r201442
The test for "same client" for the experimental nfs server over NFSv4
was broken w.r.t. byte range lock conflicts when it was the same client
and the request used the open_to_lock_owner4 case, since lckstp->ls_clp
was not set. This patch fixes it by using "clp" instead of "lckstp->ls_clp".
2010-01-17 20:49:34 +00:00
Rick Macklem
05cb54875e MFC: r201439
Fix three related problems in the experimental nfs client when
checking for conflicts w.r.t. byte range locks for NFSv4.
1 - Return 0 instead of EACCES when a conflict is found, for F_GETLK.
2 - Check for "same file" when checking for a conflict.
3 - Don't check for a conflict for the F_UNLCK case.
2010-01-17 20:18:59 +00:00
Andrew Thompson
e18bb09e1a Hook up uhso to the build. 2010-01-17 18:37:36 +00:00
Andrew Thompson
300db511e2 MFC r202054
Add the Globetrotter GE40x.
2010-01-17 18:36:22 +00:00
Andrew Thompson
ebd4481685 MFC r201766
Remove unneeded includes.
2010-01-17 18:33:47 +00:00
Andrew Thompson
dd079737f0 MFC r201714
Fix debug printf on 64bit arches.
2010-01-17 18:33:05 +00:00
Andrew Thompson
09a54b8e79 MFC r201701
Add new umass quirks for Western Digital MYBook and JMicron JM20337.

PR:		usb/142225, usb/142228
Submitted by:	Thomas Ward, Yoshikazu GOTO
2010-01-17 18:32:20 +00:00
Andrew Thompson
9d25e8387f MFC r201681
Improve u3g device ejecting by providing additional methods for the eject
 command in the usb_msctest routines, as well as a general tidyup.
2010-01-17 18:31:27 +00:00
Andrew Thompson
6b5b582259 MFC r201680
scratch_size was incorrectly passed as language ID when retrieving the language
 ID table, this broke string retrieval on some devices.

Submitted by:	Hans Petter Selasky
Reported by:	Renato Botelho
2010-01-17 18:30:37 +00:00
Andrew Thompson
e8f0a2d170 MFC r201318
Add new device ID to uipaq driver

PR:		usb/141936
Submitted by:	HASHI Hiroaki
2010-01-17 18:29:30 +00:00
Andrew Thompson
bc4acc704f MFC r202181,202243,202270
Add a driver by Fredrik Lindberg for Option HSDPA USB devices. These differ
 from standard 3G wireless units by supplying a raw IP/IPv6 endpoint rather than
 using PPP over serial. uhsoctl(1) is used to initiate and close the WAN
 connection.

Obtained from:	Fredrik Lindberg <fli@shapeshifter.se>
2010-01-17 18:22:42 +00:00
Michael Tuexen
06ee5047d5 MFC 201523
Correct usage of parenthesis.
2010-01-17 18:18:01 +00:00
Michael Tuexen
45bde0da39 MFC 199459
Get rid of unused fields addr_over which is never really used,
only copied around.
2010-01-17 17:49:28 +00:00
Michael Tuexen
64224569da MFC 199374
Fix a bug where queued ASCONF messags are not sent out.
From Irene Ruengeler.
2010-01-17 17:46:48 +00:00
Michael Tuexen
533e1ca310 MFC 198621
Improve round robin stream scheduler and cleanup some code.
2010-01-17 17:45:09 +00:00
Michael Tuexen
53b14b7294 MFC 197341
Fix errnos.
2010-01-17 17:41:43 +00:00
Michael Tuexen
fb7bf5f374 MFC 198499
Improve the round robin stream scheduler.
2010-01-17 17:10:17 +00:00
Michael Tuexen
33dabcc064 MFC 199437
Use always LIST_EMPTY instead of sometime SCTP_LIST_EMPTY,
which is defined as LIST_EMPTY.
2010-01-17 17:05:59 +00:00
Michael Tuexen
24a263d9da MFC 199372
Do not start the iterator when there are no associations.
This fixes a bug found by Irene Ruengeler.
2010-01-17 17:03:40 +00:00
Michael Tuexen
801fc2d035 MFC 199369
Do not hold the lock longer than necessary.
2010-01-17 17:01:01 +00:00
Michael Tuexen
a8725a275a MFC 198522:
Bugfix: Use formula from section 7.2.3 of RFC 4960. Reported by Martin Becke.
2010-01-17 16:58:37 +00:00
Bjoern A. Zeeb
66cbfdf290 MFC r202116:
Adjust a comment to reflect reality, as we have proper source
  address selection, even for IPv4, since r183571.

  Pointed out by:	Jase Thew (bazerka beardz.net)
2010-01-17 13:42:07 +00:00
Bjoern A. Zeeb
cd10550438 MFC r201995:
Correct a typo.
2010-01-17 13:38:11 +00:00
Bjoern A. Zeeb
8f335c80b5 MFC r201898:
Add comments trying to explain what bad things happen here, i.e.
  how hashed MD5/SHA are implemented, abusing Final() for padding and
  sw_octx to transport the key from the beginning to the end.

  Enlightened about what was going on here by: cperciva
  Reviewed by:  cperciva
2010-01-17 13:36:13 +00:00
Bjoern A. Zeeb
71902ae69a MFC r201742:
After adding an SDT provider for opencrypto in r199884 we should also
  depend on opt_kdtrace.h for the module build.

  Submitted by: (Andre.Albsmeier siemens.com)
2010-01-17 13:28:06 +00:00
Bjoern A. Zeeb
06f8631988 MFC r201688:
Correct a typo.

  Submitted by: sn_ (sn_ gmx.net) on hackers@
2010-01-17 13:23:53 +00:00
Mitsuru IWASAKI
d077836245 MFC r201605: Update acpi_ibm syctl nodes on resume. 2010-01-17 06:24:09 +00:00
Marius Strobl
08fe729d97 MFC: r201899
Some style(9) fixes
2010-01-16 12:18:44 +00:00
Marius Strobl
964863ced5 MFC: r201896
As nfsm_srvmtofh_xx() assumes the 4-byte alignment required by XDR
ensure the mbuf data is aligned accordingly by calling nfs_realign()
in fha_extract_info(). This fix is orthogonal to the problem solved
by r199274/r199284 (MFC'ed to stable/8 in r199733).

PR:		142102 (second part)
2010-01-16 12:16:38 +00:00
Alexander Motin
ea0c5a5936 Partially revert r202428. There is no bus_describe_intr() on RELENG_8. 2010-01-16 07:55:46 +00:00
Marcel Moolenaar
fdc6e8a301 MFC rev 201941:
Remove file system support based on the simple file system protocol.

MFC rev 201966:
Remove debugging printf().
2010-01-16 04:34:03 +00:00
Alexander Motin
392777822f MFC r202011:
While AHCI specification tells that multi-vector MSI doesn't use global IS
register, nVidia chipsets have different oppinion, requiring every interrupt
to be acknowledged there.

While there, add interrupt descriptions in multi-vector MSI mode.
2010-01-15 23:58:37 +00:00
Alexander Motin
8e7a844b9b MFC r201645:
Change the way in which zero stripesize is handled. Instead of reporting
zero stripeoffset in such case (as if device has no stripes), report offset
from the beginning of the media (as if device has single infinite stripe).

This gives partitioning tools information, required to guess better
partition alignment, in case if hardware doesn't report it's stripe size.
For example, it should give disklabel info about odd offset made by fdisk.
2010-01-15 23:56:19 +00:00
Konstantin Belousov
217f185c22 MFC r201890:
Set md_ldt after md_ldt_sd is populated.
2010-01-15 22:19:51 +00:00
Marius Strobl
72021af065 MFC: r201052, r201200, r202003, r202010, r202023
Add a driver for the `Fire' JBus to PCIe bridges found in at least
the Sun Fire V215/V245 and Sun Ultra 25/45 machines. This driver also
already includes all the code to support the `Oberon' Uranus to PCIe
bridges found in the Fujitsu-Siemens based Mx000 machines but due to
lack of access to such a system for testing, probing of these bridges
is currently disabled.
Unfortunately, the event queue mechanism of these bridges for MSIs/
MSI-Xs matches our current MD and MI interrupt frameworks like square
pegs fit into round holes so for now we are generous and use one event
queue per MSI, which limits us to 35 MSIs/MSI-Xs per Host-PCIe-bridge
(we use one event queue for the PCIe error messages). This seems
tolerable as long as most devices just use one MSI/MSI-X anyway.
Adding knowledge about MSIs/MSI-Xs to the MD interrupt code should
allow us to decouple the 1:1 mapping at the cost of no longer being
able to bind MSIs/MSI-Xs to specific CPUs as we currently have no
reliable way to quiesce a device during the transition of its MSIs/
MSI-Xs to another event queue. This would still require the problem
of interrupt storms generated by devices which have no one-shot
behavior or can't/don't mask interrupts while the filter/handler is
executed (like the older PCIe NICs supported by bge(4)) to be solved
though.
2010-01-15 21:45:46 +00:00
Marius Strobl
8e52edcf3b MFC: r202006
Add epic(4), a driver for the front panel LEDs in Sun Fire V215/V245.
It's named after the driver doing the same job in OpenSolaris.
2010-01-15 19:12:33 +00:00
Marius Strobl
455564ab5c MFC: r201932
- Add code allowing a network device to only be open and closed once
  by keeping it opened after the first open and closing it via the
  cleanup handler when NETIF_OPEN_CLOSE_ONCE is defined in order to
  avoid the open-close-dance on every file access which with firmware
  that for example performs an auto-negotiation on every open causes
  netbooting to take horribly long. Basically the behavior with this
  knob enabled resembles the one employed between r60506 and r177108
  (and for sparc64 also again since r182919) with the addition that
  the network device now is closed eventually before entering the
  kernel and before rebooting. Actually I think this should be the
  desired MI behavior, however the U-Boot loader actually requires
  net_close() to be called after every transaction in order for some
  local shutdown operations to be performed (and which I think thus
  will break on concurrent opens, i.e. when netdev_opens is > 1, like
  the loader does at least for disks when LOADER_GZIP_SUPPORT is
  enabled).
- Use NETIF_OPEN_CLOSE_ONCE to replace the hack, which artificially
  increased netdev_opens for sparc64 in order to keep the network
  device opened forever, as at least some firmware versions require
  the network device to be closed eventually before entering the
  kernel or otherwise will DMA received packets to stale memory.
  The powerpc OFW loader probably wants NETIF_OPEN_CLOSE_ONCE to be
  set as well for the same reasons.
2010-01-15 19:06:33 +00:00
Marius Strobl
1a6cae7f37 MFC: r201901
Remove clause 3 and 4 from TNF licenses (this was the only 4-clause TNF
license FreeBSD had in sys/boot).

Obtained from:	NetBSD
2010-01-15 16:57:49 +00:00
Marius Strobl
39759286df MFC: r201396, r201410
- Demapping unused kernel TLB slots has proven to work reliably so move
  the associated debugging under bootverbose.
- Remove freebsd4_sigreturn(); given that FreeBSD 4 didn't supported
  sparc64 this only ever served as a transition aid prior to FreeBSD
  5.0 and is unused by default since COMPAT_FREEBSD4 was removed from
  GENERIC in r143072 nearly 5 years ago.
2010-01-15 16:54:59 +00:00
Marius Strobl
bfb0b715ce MFC: r201395
- Preserve the PROM IOMMU in order to allow OFW drivers to continue to
  work.
- Sanity check the parameters passed to the implementations of the
  pcib_{read,write}_config() methods. Using illegal values can cause
  no real harm but it doesn't hurt to avoid unnecessary data error
  traps requiring to flush and re-enable the level 1 caches.
2010-01-15 16:46:03 +00:00
Marius Strobl
98fb63cac1 MFC: r201199
- Prefer i and j over i and n for temporary integer variables.
- Wrap/shorten too long lines.
- Remove a redundant variable and an unnecessary cast in schizo(4).
2010-01-15 16:42:39 +00:00
Marius Strobl
5896e2fa27 MFC: r201009
Remove clause 3 from Izumi Tsutsui's licenses.

Obtained from:	NetBSD
2010-01-15 16:29:40 +00:00
Marius Strobl
b70d493910 MFC: r201008
Style changes

Obtained from:	NetBSD (mc146818reg.h)
2010-01-15 16:27:57 +00:00
Marius Strobl
2a2cbae7cb MFC: r201005, r201371
- Take advantage of bus_{read,write}_*(9).
- Set dow = -1 in mk48txx_gettime() because some drivers (for example
  the NetBSD and OpenBSD mk48txx(4)) don't set it correctly.
2010-01-15 15:47:31 +00:00
Marius Strobl
1051ec0b8a MFC: r201004
Remove clause 3 and 4 from TNF licenses.

Obtained from:	NetBSD
2010-01-15 15:42:14 +00:00
Marius Strobl
3425abf549 MFC: r201003
Style changes
2010-01-15 15:40:44 +00:00
Marius Strobl
435ada6626 - Hook up the default implementations of the MSI/MSI-X pcib_if methods
so requests may bubble up to a host-PCI bridge driver.
- Distinguish between PCI and PCIe bridges in the device description
  so it's a bit easier to follow what hangs off of what in the dmesg.
  Unfortunately we can't also tell PCI and PCI-X apart based on the
  information provided in the OFW device tree.
- Add quirk handling for the ALi M5249 found in Fire-based machines
  which are used as a PCIe-PCIe bridge there. These are obviously
  subtractive decoding as as they have a PCI-ISA bridge on their
  secondary side (and likewise don't include the ISA I/O range in
  their bridge decode) but don't indicate this via the class code.
  Given that this quirk isn't likely to apply to all ALi M5249 and
  I have no datasheet for these chips so I could implement a check
  using the chip specific bits enabling subtractive decoding this
  quirk handling is added to the MD code rather than the MI one.
2010-01-15 15:38:49 +00:00
Marius Strobl
9d65a8f834 MFC: r200947
Add missing locking in intr_bind().
2010-01-15 15:36:12 +00:00
Marius Strobl
95915f9fa6 MFC: r200946
Execute the cleanup handlers before jumping to the kernel just
like the other architectures do.
2010-01-15 15:28:57 +00:00
Marius Strobl
e6af3b7bb8 MFC: r200945
- Consistently wrap debugging in NETIF_DEBUG. This basically merges
  NetBSD rev 1.19.
- Make the functions match their prototypes regarding static.
2010-01-15 15:27:17 +00:00
Yoshihiro Takahashi
b304370214 MFC: revision 201342
Reimplement the boot2 for pc98 completely.
  It's based on the newest i386's one and has the advantage of:

   - ELF binary support.
   - UFS2 filesystem support.
   - Many FreeBSD slices support on a disk.
2010-01-15 12:27:46 +00:00
Marius Strobl
854f8af819 MFC: r200944
Revert r183628 as with the current ata(4) ATAPI DMA with AcerLabs
M5229 appears to be once again fixed. If this happens to return
we probably should disable ATAPI DMA in ataacerlabs(4) instead
just like the Linux libATA does.
2010-01-15 12:07:30 +00:00
Yoshihiro Takahashi
cf83985263 MFC: revision 201339 and 201340
- Add setting machine type support to the loader.
  - Don't use 15M-16M area on pc98.  It's reserved for some devices.
2010-01-15 11:26:20 +00:00
Pyun YongHyeon
073ffa6670 MFC r201769:
Enable ste(4). ste(4) should work on all architectures.
2010-01-14 22:36:06 +00:00
Pyun YongHyeon
6b15d2af78 MFC r200950,200955,200965-200966,201767-201768
r200950:
  Implement RX interrupt moderation using one-shot timer interrupt.
  Unlike TX interrupt, ST201 does not provide any mechanism to
  suppress RX interrupts. ste(4) can generate more than 70k RX
  interrupts under heavy RX traffics such that these excessive
  interrupts make system useless to process other useful things.
  Maybe this was the major reason why polling support code was
  introduced to ste(4).
  The STE_COUNTDOWN register provides a programmable counter that
  will generate an interrupt upon its expiration. We program
  STE_DMACTL register to use 3.2us clock rate to drive the counter
  register. Whenever ste(4) serves RX interrupt, the driver rearm
  the timer to expire after STE_IM_RX_TIMER_DEFAULT time and disables
  further generation of RX interrupts. This trick seems to work well
  and ste(4) generates less than 8k RX interrupts even under 64 bytes
  UDP torture test. Combined with TX interrupts, the total number of
  interrupts are less than 10k which looks reasonable on heavily
  loaded controller.

  The default RX interrupt moderation time is 150us. Users can change
  the value at any time with dev.ste.%d.int_rx_mod sysctl node.
  Setting it 0 effectively disables the RX interrupt moderation
  feature. Now we have both TX/RX interrupt moderation code so remove
  loop of interrupt handler which resulted in sub-optimal performance
  as well as more register accesses.

r200955:
  Add suspend/resume support as well as basic WOL.
  While I'm here simplify SIOCSIFCAP handler.

r200965:
  Update if_iqdrops in case of RX buffer allocation failure.

r200966:
  ether_ifattach sets if_mtu, remove unnecessary code.

r201767:
  Fix EEPROM access code to return data in host byte order.
  EEPROM on ST201 always returns 16bits data with little endian
  format so conversion to host order is required.
  This change fixes inversed ethernet address on sparc64.

r201768:
  Make sure to store dma address of RX buffer in little endian form.
  This fixes the last bug which keeps ste(4) from working on sparc64.
2010-01-14 22:26:52 +00:00
Pyun YongHyeon
812b4b875d MFC r200904-200908,200910-200913
r200904:
  Don't reinitialize controller if driver is already running. This
  reduces number of link state UP/DOWN changes.

r200905:
  Reimplement controller reset. Datasheet says full reset takes about
  1ms. Since we switched to memory register mapping make sure to
  flush PCI posted write by reading the register again.
  While I'm here add additional delays in loop while driver waits the
  completion of the reset.

r200906:
  Overhaul RX filter programming.
   o Let RX filter handler program promiscuous/multicast filter as
     well as broadcasting.
   o Remove unnecessary register access.
   o Simplify ioctl handler and have set_rxfilter to handle
     IFF_PROMISC and IFF_ALLMULTI change instead of directly
     programming the controller.
   o Removed unnecessary error variable reinitialization in ioctl
     handler.
   o Add IFF_DRV_RUNNING check before programming multicast filter.
   o Configure maximum allowed frame length before enabling MAC.
     Datasheet didn't say the exact ordering of programming sequence
     but it looks more natural to set maximum allowed frame length
     first prior to enabling controller.

r200907:
  Don't report link status if driver is not running.

r200908:
  Report the correct result of mii_mediachg(). Previously it always
  used to return success without respect to the result.
  While I'm here use mii_mediachg() in ste_init_locked which allows
  driver to use currently configured media. ste_ifmedia_upd() is
  supposed to be called whenever user changes current media settings.

r200910:
  Implement hardware MAC statistics counter support. The counters
  could be accessed with dev.ste.0.stats sysctl node.

r200911:
  Remove unused duplicated register definition. It seems the
  definition was made to access STE_ASICCTL register as 16bits but
  ste(4) always access the register as 32bits so it was never used
  before.

r200912:
  Correct STE_COUNTDOWN register offset. The datasheet was wrong.

r200913:
  We don't need to generate DMA complete interrupt for every
  transmitted frames. So request interrupt for every 16th frames. Due
  to the limitation of hardware we can't suppress the interrupt as
  driver should have to check TX status register. The TX status
  register can store up to 31 TX status so driver can't send more
  than 31 frames without reading TX status register.
  With this change controller would not generate TX completion
  interrupt for every frame, so reclaim transmitted frames in
  ste_tick().
2010-01-14 22:15:51 +00:00
Pyun YongHyeon
0d9ae5891e MFC r200854,200856,200865,200873,200875,200877,200884
r200854:
  Add minimal dealy while ste(4) is waiting for the end of active DMA
  cycle.

r200856:
  Introduce sc_flags member variable and use it to keep track of
  link state and PHY related information.
  Remove ste_link and ste_one_phy variable of softc as it's not used
  anymore.
  While I'm here add IFF_DRV_RUNNING check in ste_start_locked().

r200865:
  Reimplement miibus_statchg method. Don't rely on link state change
  interrupt. If we want to use link state change interrupt ste(4)
  should also implement auto-negotiation complete handler as well as
  various PHY access handling. Now link state change is handled by
  mii(4) polling so it will automatically update link state UP/DOWN
  events which in turn make ste(4) usable with lagg(4).

  r199559 added a private timer to drive watchdog and the timer also
  used to drive MAC statistics update. Because the MAC statistics
  update is called whenever statistics counter reaches near-full, it
  drove watchdog timer too fast such that it caused false watchdog
  timeouts under heavy TX traffic conditions.
  Fix the regression by separating ste_stats_update() from driving
  watchdog timer and introduce a new function ste_tick() that handles
  periodic job such as driving watchdog, MAC statistics update and
  link state check etc.
  While I'm here clear armed watchdog timer in ste_stop().

r200873:
  Instead of relying on hard resetting of controller to stop
  receiving incoming traffics, try harder to gracefully stop active
  DMA cycles and then stop MACs. This is the way what datasheet
  recommends and seems to work reliably. Resetting controller while
  active DMAs are in progress is bad thing as we can't predict how
  DMAs touche allocated TX/RX buffers. This change ensures controller
  stop state before attempting to release allocated TX/RX buffers.
  Also update MAC statistics which could have been updated during the
  wait time of MAC stop.

  While I'm here remove unnecessary controller resets in various
  location. ste(4) no longer relies on hard controller reset to stop
  controller and resetting controller also clears all configured
  settings which makes it hard to implement WOL in near future.
  Now resetting a controller is performed in ste_init_locked().

r200875:
  Prefer memory space register mapping over io space. If memory space
  mapping fails fall back to old io space mapping.
  While I'm here use PCIR_BAR macro.

r200877:
  Prefer bus_write_{1,2,4}/bus_read_{1,2,4} to
  bus_space_write_{1,2,4}/bus_space_read_{1,2,4}.
  Remove unused ste_bhandle and ste_btag in softc.

r200884:
  Reimplement Tx status error handler as recommended by datasheet.
  If ste(4) encounter TX underrun or excessive collisions the TX MAC
  of controller is stalled so driver should wake it up again. TX
  underrun requires increasing TX threshold value to minimize
  further TX underruns. Previously ste(4) used to reset controller
  to recover from TX underrun, excessive collision and reclaiming
  error. However datasheet says only TX underrun requires resetting
  entire controller. So implement ste_restart_tx() that restarts TX
  MAC and do not perform full reset except TX underrun case.
  Now ste(4) uses CSR_READ_2 instead of CSR_READ_1 to read
  STE_TX_STATUS register. This way ste(4) will also read frame id
  value and we can write the same value back to STE_TX_FRAMEID
  register instead of overwriting it to 0. The datasheet was wrong
  in write back of STE_TX_STATUS so add some comments why we do so.
  Also always invoke ste_txeoc() after ste_txeof() in ste_poll as
  without reading TX status register can stall TX MAC.
2010-01-14 22:00:33 +00:00
Pyun YongHyeon
0f9ecfd9cc MFC r200853:
Add bus_dma(9) and endianness support to ste(4).
   o Sorted includes and added missing header files.
   o Added basic endianness support. In theory ste(4) should work on
     any architectures.
   o Remove the use of contigmalloc(9), contigfree(9) and vtophys(9).
   o Added 8 byte alignment limitation of TX/RX descriptor.
   o Added 1 byte alignment requirement for TX/RX buffers.
   o ste(4) controllers does not support DAC. Limit DMA address space
     to be within 32bit address.
   o Added spare DMA map to gracefully recover from DMA map failure.
   o Removed dead code for checking STE_RXSTAT_DMADONE bit. The bit
     was already checked in each iteration of loop so it can't be true.
   o Added second argument count to ste_rxeof(). It is used to limit
     number of iterations done in RX handler. ATM polling is the only
     consumer.
   o Removed ste_rxeoc() which was added to address RX stuck issue
     (cvs rev 1.66). Unlike TX descriptors, ST201 supports chaining
     descriptors to form a ring for RX descriptors. If RX descriptor
     chaining is not supported it's possible for controller to stop
     receiving incoming frames once controller pass the end of RX
     descriptor which in turn requires driver post new RX
     descriptors to receive more frames. For TX descriptors which
     does not support chaning, we exactly do manual chaining in
     driver by concatenating new descriptors to the end of previous
     TX chain.
     Maybe the workaround was borrowed from other drivers that does
     not support RX descriptor chaining, which is not valid for ST201
     controllers. I still have no idea how this address RX stuck
     issue and I can't reproduce the RX stuck issue on DFE-550TX
     controller.
   o Removed hw.ste_rxsyncs sysctl as the workaround was removed.
   o TX/RX side bus_dmamap_load_mbuf_sg(9) support.
   o Reimplemented optimized ste_encap().
   o Simplified TX logic of ste_start_locked().
   o Added comments for TFD/RFD requirements.
   o Increased number of RX descriptors to 128 from 64. 128 gave much
     better performance than 64 under high network loads.
2010-01-14 21:45:39 +00:00
Andrew Gallatin
1d2d3276c2 MFC: r202120:
Update mxge(4) firmware to 1.4.48b (latest available) from Myricom.
2010-01-14 21:30:06 +00:00
Andrew Gallatin
ed0e6c2a44 MFC r202121:
Use better default RSS hash (src + dst, rather than just src port)
2010-01-14 21:10:36 +00:00
Andrew Gallatin
3070a40c8a MFC 202119: Fix reporting of 10G Twinax media 2010-01-14 20:59:02 +00:00
Pyun YongHyeon
41c95608a0 MFC r200798,200801,200803-200804,200808,200810
r200798:
  Use ANSI function definations.

r200801:
   o Remove unnecessary return statement.
   o Remove register keyword.

r200803:
  s/u_intXX_t/uintXX_t/g

r200804:
  Remove trailing white spaces.

r200808:
  style(9)

r200810:
  Sort function prototyes.
2010-01-14 20:47:49 +00:00
Pyun YongHyeon
699df0c4fa Partial merge r199559:
- Add a private timer to drive the transmit watchdog instead of using
    if_watchdog and if_timer.
  - Fix some issues in detach for sn(4), ste(4), and ti(4).  Primarily this
    means calling ether_ifdetach() before anything else.
2010-01-14 20:38:40 +00:00
Rick Macklem
ea6ffaa742 MFC: r201345
Fix the experimental NFS client so that it can create Unix
domain sockets on an NFSv4 mount point. It was generating
incorrect XDR in the request for this case.

Tested by:	infofarmer
2010-01-14 17:35:07 +00:00
Marius Strobl
d07d09d79f MFC: r200938
- Don't check for a valid interrupt controller on every interrupt
  in intr_execute_handlers(). If we managed to get here without an
  associated interrupt controller we have way bigger problems.
  While at it predict stray vector interrupts as false as they are
  rather unlikely.
- Don't blindly call the clear function of an interrupt controller
  when adding a handler in inthand_add() as interrupt controllers
  like the one driven by upa(4) are auto-clearing and thus provide
  NULL instead.
2010-01-13 21:23:27 +00:00
Marius Strobl
74794d0d58 MFC: r200926
Recognize the NS16552 found in PCIe-based sun4u machines.
2010-01-13 21:21:29 +00:00
Marius Strobl
1f0040f79f MFC: r200925
- By re-arranging the code in OF_decode_addr() somewhat and accepting
  a bit of a detour we can just iterate through the banks array instead
  of having to calculate every offset. This change is inspired by the
  powerpc version of this function.
- Add support for the JBus to EBus bridges which hang off of nexus(4).
2010-01-13 21:19:46 +00:00
Marius Strobl
f07dd8aaa5 MFC: r200924
Style changes.
2010-01-13 21:17:45 +00:00
Marius Strobl
b740c16a21 MFC: r200923
- Add support for the IOMMUs of Fire JBus to PCIe and Oberon Uranus
  to PCIe bridges.
- Add support for talking the PROM mappings over to the kernel IOTSB
  just like we do with the kernel TSB in order to allow OFW drivers
  to continue to work.
- Change some members, parameters and variables to unsigned where
  more appropriate.
2010-01-13 21:16:07 +00:00
Marius Strobl
c05db9b041 MFC: r200922
Fix whitespace according to style(9).
2010-01-13 21:13:50 +00:00
Marius Strobl
bdb2fdd6af MFC: r200921
- Add quirk handling for ALi M5229, mainly setting the magic "force
  enable IDE I/O" bit which prevents data access traps with revision
  0xc8 in Fire-based machines when pci(4) enables PCIM_CMD_PORTEN.
- Like for sun4v also don't add the PCI side of host-PCIe bridges to
  the bus on sun4u as they don't have configuration space implement
  there either.
2010-01-13 21:12:27 +00:00
Marius Strobl
8677820407 MFC: r200920
- Sort the prototypes.
- Add macros to ease the access of device configuration space in
  ofw_pcibus_setup_device().
2010-01-13 21:08:57 +00:00
Marius Strobl
778251c8a4 MFC: r200918
Add structures for OFW MSI/MSI-X support. These are identical for
both sun4u and sun4v.
2010-01-13 21:04:56 +00:00
Marius Strobl
f168880574 MFC: r200917
Hook ebus(4) and isa(4) up to the sun4v LINT build in order to
ensure that their compilation doesn't break as they are expected
to work as-is now (but aren't actually run-time tested).
2010-01-13 21:03:04 +00:00
Marius Strobl
7d0ba636c6 MFC: r200916
Remove devices which are/were only relevant for sun4u.
2010-01-13 20:59:36 +00:00
Marius Strobl
4cb21bdfca MFC: r200915
Don't probe the bq4802 variant found in Ultra 25 and 45 for now as
this chip isn't MC146818 compatible and requires different handlers
(but which I can't test due to lack of such hardware).
2010-01-13 20:51:21 +00:00
Marius Strobl
f71a779bb7 MFC: r200914
Don't use an out register to hold the vector number across the call
of the interrupt handler in intr_fast() as the handler might clobber
it (no in-tree handler currently does but an upcoming one will).
While at it, tidy the register usage in the interrupt counting code.
2010-01-13 20:40:49 +00:00
Marius Strobl
96642ec4ae MFC: r200880
- Correct an off-by-one error when calculating the end of a child
  range.
- Spell the PCI TLA in uppercase.
2010-01-13 20:35:27 +00:00
Marius Strobl
990824aa76 MFC: r200879
- Add support for the JBus to EBus bridges which hang off of nexus(4)
  and are found in sun4u and sun4v machines based on the Fire ASIC.
- Initialize the configuration space of the PCI to EBus variant the
  same way as OpenSolaris does.
2010-01-13 20:32:54 +00:00
Marius Strobl
4acf9b4548 MFC: r200878
- Add macros for the states of the interrupt clear registers.
- Change INTMAP_VEC() to take an INO as its second argument rather
  than an INR. The former is what I actually intended with this
  macro and how it's currently used.
2010-01-13 20:07:45 +00:00
Marius Strobl
b61d79e43e MFC: r200876
Make these constants unsigned which is more appropriate.
2010-01-13 20:05:32 +00:00