Commit Graph

88289 Commits

Author SHA1 Message Date
Navdeep Parhar
7851c3eee3 Allow cxgbe to be built into a kernel with "device cxgbe."
MFC after:	1 week
2012-09-13 09:01:52 +00:00
Ed Schouten
5b5d76847d Rename __member2struct() to __containerof().
Compared to __member2struct(), this macro has the following advantages:

- It ensures that the type of the pointer is compatible with the member
  field of the structure (or a void pointer).
- It works properly in combination with volatile and const, though
  unfortunately it drops these qualifiers from the returned value.

mdf@ proposed to add the container_of() macro, just like Linux has.
Eventually I decided against this, as <sys/param.h> is included all over
the place. It seems container_of() on Linux is specific to the kernel,
not userspace. I'd rather not pollute userspace with this.

I also thought about adding __container_of(), but this would have two
advantages. Xorg seems to already have a __container_of(), which is not
compatible with this version. Also, the underscore in the middle
conflicts with our existing macros (__offsetof, __rangeof, etc).

I'm changing member2struct() to use its old code, as the extra
strictness of this new macro conflicts with existing code (read: cxgb).

MFC after:	1 month
2012-09-13 08:13:01 +00:00
Adrian Chadd
03a51ef8f4 Enable fractional 5G mode on half/quarter rate channels.
Obtained from:	Linux ath9k
2012-09-13 07:25:41 +00:00
Adrian Chadd
77ffc4c1fc Flip on half/quarter rate support.
No, this isn't HT/5 and HT/10 support.  This is the 11a half/quarter
rate support primarily used by the 4.9GHz and GSM band regulatory
domains.

This is definitely a work in progress.

TODO:

* everything in the last commit;
* lots more interoperability testing with the AR5212 half/quarter rate
  support for the relevant chips;
* Do some interop testing on half/quarter rate support between _all_
  the 11n chips - AR5416, AR9160, AR9280 (and AR9285/AR9287 when 2GHz
  half/quarter rate support is coded up.)
2012-09-13 07:24:14 +00:00
Adrian Chadd
ce801478d2 Introduce an AR5416 flavour of the IFS and mac usec/timing configuration
used when running the chips in half/quarter rate.

This sets up some default parameters which are then overridden by the
driver (which manually configures things like slot timing at interface
start time.)

Although this is a copy-and-modify from the AR5212 HAL, I did peek
at the reference HAL and the ath9k driver to see what they did.
Ath9k in particular doesn't hard-code this - instead, their version
of ar5416InitUserSettings() does all of the relevant math.

TODO:

* do the math, not hard code things!
* fix the mac clock calculation for the AR9287; since it runs the
  MAC clock at a higher rate, requiring all the duration calculations
  to change;
* Do a whole lot more validation for half/quarter rates.

Obtained from:	Qualcomm Atheros, Linux ath9k
2012-09-13 07:22:40 +00:00
Adrian Chadd
41b53a9aaf Call the ar5212SetCoverageClass() function for now.
Some of the math is a little wrong thanks to clocks in 11a mode running
at 44MHz when in fast clock mode (rather than 40MHz, which the chips
before AR9280 ran 11a in).  That'll have to be addressed in a future commit.
2012-09-13 07:19:53 +00:00
Adrian Chadd
c19a7918f3 Add register defintions for the AR5416 TX/RX latency fields.
Obtained from:	Qualcomm Atheros
2012-09-13 07:17:58 +00:00
Adrian Chadd
1690edb32c Compensate for half/quarter rate differences in MAC clock speed.
This fixes the incorrect slot (and likely ACK/RTS timeout) values
which I see when enabling half/quarter rate support on the AR9280.

The resulting math matches the expected calculated default values.
2012-09-13 07:17:29 +00:00
Navdeep Parhar
8a7ba352b0 Update interface to firmware 1.6.2 and include the firmware in the driver.
Obtained from:	Chelsio
MFC after:	1 week
2012-09-13 06:32:52 +00:00
Alan Cox
0b35b54b4d Simplify the kernel pmap locking in pmap_enter_pv(). While I'm here, tidy
up the comments and whitespace.

Tested by:	cognet
2012-09-13 06:16:49 +00:00
Peter Grehan
60ff334285 No need to leak these into the includer's namespace.
Submitted by:	Bryan Venteicher bryanv at daemoninthecloset org
2012-09-13 00:42:56 +00:00
Peter Grehan
c44ef550e1 Relax requirement of certain mb()s
Submitted by:	Bryan Venteicher bryanv at daemoninthecloset org
2012-09-13 00:36:46 +00:00
Ed Schouten
e48063402c Correctness: use __member2struct() on the correct fields.
The prev-pointers point to the next-pointers of the previous element --
not the ENTRY structure. The next-pointers are stored in the ENTRY
structures first, so the code would already work correctly. Still, it is
more accurate to use the next-fields.

To prevent misuse of __member2struct() in the future, I've got a patch
that requires the pointer to be passed to this macro to be compatible
with the member of the structure. I'll commit this patch after I've
tested it properly.

MFC after:	1 month.
2012-09-12 22:54:11 +00:00
Attilio Rao
e3ae0dfe69 Improve check coverage about idle threads.
Idle threads are not allowed to acquire any lock but spinlocks.
Deny any attempt to do so by panicing at the locking operation
when INVARIANTS is on. Then, remove the check on blocking on a
turnstile.
The check in sleepqueues is left because they are not allowed to use
tsleep() either which could happen still.

Reviewed by:	bde, jhb, kib
MFC after:	1 week
2012-09-12 22:10:53 +00:00
Attilio Rao
faa1082aa2 Tweak the commit message in case of panic for sleeping from threads
with TDP_NOSLEEPING on.

The current message has no informations on the thread and wchan
involed, which may be useful in case where dumps have mangled dwarf
informations.

Reported by:    kib
Reviewed by:	bde, jhb, kib
MFC after:	1 week
2012-09-12 22:05:54 +00:00
Ed Schouten
4170b08388 Implement LIST_PREV().
Regular LISTs have been implemented in such a way that the prev-pointer
does not point to the previous element, but to the next-pointer stored
in the previous element. This is done to simplify LIST_REMOVE(). This
macro can be implemented without knowing the address of the list head.

Unfortunately this makes it harder to implement LIST_PREV(), which is
why this macro was never here. Still, it is possible to implement this
macro. If the prev-pointer points to the list head, we return NULL.
Otherwise we simply subtract the offset of the prev-pointer within the
structure.

It's not as efficient as traversing forward of course, but in practice
it shouldn't be that bad. In almost all use cases, people will want to
compare the value returned by LIST_PREV() against NULL, so an optimizing
compiler will not emit code that does more branching than TAILQs.

While there, make the code a bit more readable by introducing
__member2struct(). This makes STAILQ_LAST() far more readable.

MFC after:	1 month
2012-09-12 21:03:48 +00:00
Alexander Motin
a5174f1fb6 Make pxe device in lsdev really include device name, looking like this:
pxe0:    192.168.3.1:/storage/nfsroot/amd64
, instead of confusing and less useful:
      192.168.3.1:pxeboot
2012-09-12 21:00:37 +00:00
Jim Harris
7e2fcdff0b Remove some trailing whitespace. 2012-09-12 19:36:54 +00:00
Hans Petter Selasky
beefefd4b0 Fix TX FIFO sizes. Correct FIFO handling in Host mode. 2012-09-12 19:15:29 +00:00
Martin Matuska
4c5238d576 Merge recent zfs vendor changes, sync code and adjust userland DEBUG.
Illumos issued covered:
1884 Empty "used" field for zfs *space commands
3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first argument
     is zero
3028 zfs {group,user}space -n prints (null) instead of numeric GID/UID
3048 zfs {user,group}space [-s|-S] is broken
3049 zfs {user,group}space -t doesn't really filter the results
3060 zfs {user,group}space -H output isn't tab-delimited
3061 zfs {user,group}space -o doesn't use specified fields order
3064 usr/src/cmd/zpool/zpool_main.c misspells "successful"
3093 zfs {user,group}space's -i is noop
3098 zfs userspace/groupspace fail without saying why when run as non-root

References:
  https://www.illumos.org/issues/ + [issue_id]

Obtained from:	illumos (vendor/illumos, vendor/illumos-sys)
MFC after:	2 weeks
2012-09-12 18:05:43 +00:00
David E. O'Brien
43bb1a21f2 Remove duplication and centralize testing of various config(8)ed features. 2012-09-12 14:19:40 +00:00
David E. O'Brien
c475a3ea4d Not all Pmake derived makes quietly tolerate assignment from shell commands
with no output.  Add "echo" at the end these shell commands whose output is
assigned to a variable's value to ensure there is some output.

Submitted by:	John Van Horne <jvanhorne@juniper.net>
2012-09-12 14:17:11 +00:00
David E. O'Brien
72bacdc533 Replace a bare use of 'objcopy' with ${OBJCOPY} for easier cross compilation
in environments where 'objcopy' is spelled differently.

Submitted by:	John Van Horne <jvanhorne@juniper.net>
2012-09-12 13:58:18 +00:00
VANHULLEBUS Yvan
d1b835208a In NAT-T transport mode, allow a client to open a new connection just after
closing another.
It worked only in tunnel mode before.

Submitted by:	Andreas Longwitz <longwitz@incore.de>
MFC after: 1M
2012-09-12 12:14:50 +00:00
Kevin Lo
457a9cfbc1 Remove redundant check 2012-09-12 10:12:03 +00:00
Alexander Motin
189d85cc15 Fix AHCI 1.2 version checks. This should be mostly cosmetic.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	1 week
2012-09-12 09:20:37 +00:00
Kevin Lo
92665d2b55 Restart the USB transfer if the error is not USB_ERR_CANCELLED. 2012-09-12 07:59:28 +00:00
Hans Petter Selasky
d4b6c03ea9 Reduce DWC OTG polling rate by using the SOF interrupt. 2012-09-12 07:34:09 +00:00
Kevin Lo
95c79b6082 Add VFCF_READONLY flag that indicates ntfs and xfs file systems are
only supported as read-only.
2012-09-12 03:42:52 +00:00
Hans Petter Selasky
08bfef24af Add device entry for DWC OTG. 2012-09-11 22:13:37 +00:00
Hans Petter Selasky
654bedb896 Add device entry for DWC OTG. 2012-09-11 22:10:36 +00:00
Hans Petter Selasky
537aca954f Fix missing parts of DWC OTG host mode support. The host mode support
of the DWC OTG is very simple in PIO mode, and we need to re-transmit
data when NAK is received among other things. We probably will need
to implement some kind of rate limitation on the NAK-ing.
2012-09-11 22:08:19 +00:00
Gleb Smirnoff
4a7f7b10b5 When synchronizing, include in the config dump amount of
bytes syncronized.
  The rationale behind this is the following: for large disks the
percent synchronisation counter ticks too seldom, and monitoring
software (as well as human operator) can't tell whether
synchronisation goes on or one of disks got stuck. On an idle
server one can look into gstat and see whether synchronisation goes
on or not, but on a busy server that won't work. Also, new value
monitored can be differentiated obtaining the synchronisation speed
quite precisely.

Submitted by:	Konstantin Kukushkin <dark ramtel.ru>
Reviewed by:	pjd
2012-09-11 20:20:13 +00:00
Andriy Gapon
31482433f4 revert r240344: cpu_devices[] is used in other functions and must be kept
Reported by:	gjb, glebius
Pointyhat to:	avg
MFC after:	1 day
X-MFC note:	fake MFC, reminder to never MFC r240344
2012-09-11 17:21:25 +00:00
Scott Long
a46570c76d Remove a prefetch() directive that, after careful testing, does more harm
than good.

Submitted by:	Fabien Thomas
Reviewed by:	jfv
2012-09-11 16:59:04 +00:00
Kevin Lo
6297d5d6f9 Prevent nump NULL pointer dereference in bmap_getlbns() 2012-09-11 09:38:32 +00:00
Andriy Gapon
4ed4f4cf95 forgotten file from r240346
Pointyhat to:	avg
MFC after:	10 days
X-MFC with:	r240346
2012-09-11 08:45:49 +00:00
Kevin Lo
8e46bf68d1 Fix style nit 2012-09-11 08:36:41 +00:00
Andriy Gapon
7ae0dc79b7 zfs boot: add a size check for a value in fzap_lookup
MFC after:	25 days
2012-09-11 07:15:11 +00:00
Andriy Gapon
4b7fc6b08e zfs boot: print only an attribute name in fzap_list
... this matches mzap_list behavior

MFC after:	12 days
2012-09-11 07:13:58 +00:00
Andriy Gapon
e644b976b0 zfs boot: fix/replace fzap_rlookup implementation
The previous one was totally bogus as it used hash value of
_output_ variable as an index for searching...
The only reliable way to do a reverse lookup here is to iterate
over all entries.

MFC after:	15 days
2012-09-11 07:12:48 +00:00
Andriy Gapon
b6910e777e zfs boot: bring zap_leaf_chunk field names in sync with kernel code
This change is cosmetic.

MFC after:	10 days
2012-09-11 07:11:32 +00:00
Andriy Gapon
9c5c3cafbd zfs: fix sa_modify_attrs handling of variable-sized attributes
- skip length_idx index for a replaced variable-sized attribute
- skip length_idx index for a removed variable-sized attribute
- also re-arranged code to make sure that length_idx is always
  incremented for variable-sized attributes
- additionally add an assertion that the number of actually produced
  attributes is the same as the expected number of resulting
  attributes

In cooperation with:	Matthew Ahrens <mahrens@delphix.com>
Tested by:	Trent Nelson <trent@snakebite.org>
Reviewed by:	Matthew Ahrens <mahrens@delphix.com> (for upstream)
To do:		get this upstreamed
MFC after:	2 weeks
2012-09-11 07:07:52 +00:00
Andriy Gapon
ccb92b3c78 acpi_cpu: free result of device_get_children
MFC after:	1 week
2012-09-11 06:26:20 +00:00
Andriy Gapon
c0e2226ce5 boot: file_loadraw should strdup name argument
... the same way it's done for type argument.

MFC after:	2 weeks
2012-09-11 06:18:36 +00:00
Andriy Gapon
9d1889cd04 a bit of trailing whitespace cleanup
MFC after:	1 week
2012-09-11 06:15:55 +00:00
Andrey V. Elsukov
915e341bac Slightly reduce an overhead for the open() call in the zfsloader.
libstand(3) tries to detect file system in the predefined order,
but zfsloader usually is used for the booting from ZFS, and there is
no need to try detect several file system types for each open() call.
2012-09-11 04:54:44 +00:00
Adrian Chadd
5d9b19f731 Clear the correct descriptor when going through the chained together
gather DMA descriptor list.

Pointy hat to: adrian@, for even USING bf->bf_desc here instead of 'ds'.
2012-09-11 04:11:42 +00:00
George V. Neville-Neil
2ce9afee65 Remove scsi_low_pisa.c from the module Makefile to keep in line
with r240325.
2012-09-10 21:57:40 +00:00
John Baldwin
a89828a2b0 Remove some more NetBSD compat shims and other unused bits from these
drivers:
- Remove scsi_low_pisa.*, they were unused.
- Remove <compat/netbsd/physio_proc.h> and calls to the stubs in that
  header.  They were empty nops.
- Retire sl_xname and use device_get_nameunit() and device_printf() with
  the underlying device_t instead.
- Remove unused {ct,ncv,nsp,stg}print() functions.
- Remove empty SOFT_INTR_REQUIRED() macro and the unused sl_irq member.
2012-09-10 18:49:49 +00:00
Alan Cox
347ebd12db Replace all uses of the vm page queues lock by a r/w lock that is private
to this pmap.

Revise some comments.

The file vm/vm_param.h includes the file machine/vmparam.h, so there is no
need to directly include it.

Tested by:	andrew
2012-09-10 16:27:19 +00:00
Alan Cox
7336315b0a Simplify pmap_unmapdev(). Since kmem_free() eventually calls pmap_remove(),
pmap_unmapdev()'s own direct efforts to destroy the page table entries are
redundant, so eliminate them.

Don't set PTE_W on the page table entry in pmap_kenter{,_attr}() on MIPS.
Setting PTE_W on MIPS is inconsistent with the implementation of this
function on other architectures.  Moreover, PTE_W should not be set, unless
the pmap's wired mapping count is incremented, which pmap_kenter{,_attr}()
doesn't do.

MFC after:	10 days
2012-09-10 16:11:29 +00:00
Hans Petter Selasky
e828eaabf4 Poll VBUS status every second, hence the AT91 GPIO library doesn't support
registering interrupt handlers yet for GPIO events.
2012-09-10 13:50:34 +00:00
Hans Petter Selasky
460febc7be Fix for IRQ hang in DWC OTG host mode. 2012-09-10 12:23:56 +00:00
Martin Matuska
6643637f67 Add assfail() and assfail3() to the opensolaris module.
Remove obsoleted intermediate cddl/compat/opensolaris/sys/debug.h.

MFC after:	2 weeks
2012-09-10 10:24:57 +00:00
Hans Petter Selasky
92a80a4cef Cleanup interrupt handling in Host Mode. 2012-09-10 08:23:56 +00:00
Rick Macklem
f4e2c07e73 Add a simple printf() based debug facility to the new nfs client.
Use it for a printf() that can be harmlessly generated for mmap()'d
files. It will be used extensively for the NFSv4.1 client.
Debugging printf()s are enabled by setting vfs.nfs.debuglevel to
a non-zero value. The higher the value, the more debugging printf()s.

Reviewed by:	jhb
MFC after:	2 weeks
2012-09-09 21:00:45 +00:00
Alexander Motin
df980c683c At least from A70M FCH chipsets AMD started to use their real vendor ID
(1022) in HPET. But according to report they still haven't fixed problem
with level-triggered interrupts.
Make workaround used for earlier chipsets apply to this new ID also.

PR:		amd64/171355
MFC after:	3 days
2012-09-09 20:00:00 +00:00
Konstantin Belousov
d9e9650a36 Allow shared lookups for nullfs mounts, if lower filesystem supports
it.  There are two problems which shall be addressed for shared
lookups use to have measurable effect on nullfs scalability:

1. When vfs_lookup() calls VOP_LOOKUP() for nullfs, which passes lookup
operation to lower fs, resulting vnode is often only shared-locked. Then
null_nodeget() cannot instantiate covering vnode for lower vnode, since
insmntque1() and null_hashins() require exclusive lock on the lower.

Change the assert that lower vnode is exclusively locked to only
require any lock.  If null hash failed to find pre-existing nullfs
vnode for lower vnode and the vnode is shared-locked, the lower vnode
lock is upgraded.

2. Nullfs reclaims its vnodes on deactivation. This is due to nullfs
inability to detect reclamation of the lower vnode.  Reclamation of a
nullfs vnode at deactivation time prevents a reference to the lower
vnode to become stale.

Change nullfs VOP_INACTIVE to not reclaim the vnode, instead use the
VFS_RECLAIM_LOWERVP to get notification and reclaim upper vnode
together with the reclamation of the lower vnode.

Note that nullfs reclamation procedure calls vput() on the lowervp
vnode, temporary unlocking the vnode being reclaimed. This seems to be
fine for MPSAFE filesystems, but not-MPSAFE code often put partially
initialized vnode on some globally visible list, and later can decide
that half-constructed vnode is not needed.  If nullfs mount is created
above such filesystem, then other threads might catch such not
properly initialized vnode. Instead of trying to overcome this case,
e.g. by recursing the lower vnode lock in null_reclaim_lowervp(), I
decided to rely on nearby removal of the support for non-MPSAFE
filesystems.

In collaboration with:	pho
MFC after:	3 weeks
2012-09-09 19:20:23 +00:00
Konstantin Belousov
bcd5bb8e57 Add a facility for vgone() to inform the set of subscribed mounts
about vnode reclamation. Typical use is for the bypass mounts like
nullfs to get a notification about lower vnode going away.

Now, vgone() calls new VFS op vfs_reclaim_lowervp() with an argument
lowervp which is reclaimed. It is possible to register several
reclamation event listeners, to correctly handle the case of several
nullfs mounts over the same directory.

For the filesystem not having nullfs mounts over it, the overhead
added is a single mount interlock lock/unlock in the vnode reclamation
path.

In collaboration with:	pho
MFC after:	3 weeks
2012-09-09 19:17:15 +00:00
Konstantin Belousov
84c3cd4f19 Add MNTK_LOOKUP_EXCL_DOTDOT struct mount flag, which specifies to the
lookup code that dotdot lookups shall override any shared lock
requests with the exclusive one. The flag is useful for filesystems
which sometimes need to upgrade shared lock to exclusive inside the
VOP_LOOKUP or later, which cannot be done safely for dotdot, due to
dvp also locked and causing LOR.

In collaboration with:	    pho
MFC after:	3 weeks
2012-09-09 19:11:52 +00:00
Hans Petter Selasky
58ecbe49f5 Implement missing USB suspend and resume support for DWC OTG driver. 2012-09-09 17:23:57 +00:00
Hans Petter Selasky
268ae63a2a Add support for DWC OTG. 2012-09-09 14:53:34 +00:00
Hans Petter Selasky
dabf69b257 Add support for DWC OTG. 2012-09-09 14:51:38 +00:00
Hans Petter Selasky
9cfd07315e Add support for host mode to the DWC OTG controller driver.
The DWC OTG host mode support should still be considered
experimental. Isochronous support for DWC OTG is not
fully implemented. Some code added derives from
Aleksandr Rybalko's dotg.c driver.
2012-09-09 14:41:34 +00:00
Andrey V. Elsukov
da1d05228c Handle LOADER_NO_DISK_SUPPORT knob in the arm and powerpc ubldr. 2012-09-09 11:40:37 +00:00
Andrey V. Elsukov
60dff4f9f8 Update according to the change of struct uboot_devdesc. 2012-09-09 11:37:17 +00:00
Andrey V. Elsukov
9efbc4f52e Build disk.c only when DISK_SUPPORT is enabled. 2012-09-09 11:34:27 +00:00
Andrey V. Elsukov
d958ec0ca3 Update uboot's disk driver to use new DISK API. 2012-09-09 11:33:06 +00:00
Andrey V. Elsukov
8be6260966 Use disk_fmtdev() and disk_parsedev() functions from the new DISK API. 2012-09-09 11:32:06 +00:00
Andrey V. Elsukov
6c96358f5f Make struct uboot_devdesc compatible with struct disk_devdesc. 2012-09-09 11:30:45 +00:00
Michael Tuexen
8225a9bc85 Whitespace changes.
MFC after: 10 days
2012-09-09 08:14:04 +00:00
Adrian Chadd
21840808c8 Make sure the aggregate fields are properly cleared - both in the
ath_buf and when forming a non-aggregate frame.

The non-11n setds function is called when TXing aggregate frames (and
yes, I should fix this!) and the non-11n TX aggregation code doesn't clear
the delimiter field.  I figure it's nicer to do that.
2012-09-09 05:06:16 +00:00
Adrian Chadd
a71362cec6 Remove TDMA #define entries from if_ath.c; they now exist in if_ath_tdma.h. 2012-09-09 04:53:10 +00:00
Michael Tuexen
fe6bb0a788 Whitespace cleanup.
MFC after: 10 days
2012-09-08 20:54:54 +00:00
Andreas Tobler
85fdca2d85 Fix loading of kernel modules at boot time for powerpc64.
Reported by:	Mathias Breuninger
MFC after:	1 week
2012-09-08 20:00:31 +00:00
Attilio Rao
16cbf13b53 Move the checks for td_pinned, td_critnest, TDP_NOFAULTING and
TDP_NOSLEEPING leaking from syscallret() to userret() so that also
trap handling is covered. Also, the check on td_locks is not duplicated
between the two functions.

Reported by:	avg
Reviewed by:	kib
MFC after:	1 week
2012-09-08 18:35:15 +00:00
Attilio Rao
fbe18392a1 Move PT_UPDATED_FLUSH() before td_locks check in order to have more
coverage also in the XEN case.

Reviewed by:	kib
MFC after:	1 week
2012-09-08 18:29:53 +00:00
Attilio Rao
324e57150d userret() already checks for td_locks when INVARIANTS is enabled, so
there is no need to check if Giant is acquired after it.

Reviewed by:	kib
MFC after:	1 week
2012-09-08 18:27:11 +00:00
Alan Cox
1c978ec48b pmap_remove:
Avoid re-walking the page table from the root for every PTE examined.

  Tidy up some of pmap_remove()'s helper functions.

pmap_enter:

  Set PV_TABLE_REF whenever the physical page being mapped is managed, not
  just when it is writeable.

  Only call pmap_update_page() when the old mapping was valid.  If there was
  no prior valid mapping, then pmap_update_page() serves no useful purpose.
  However, it will interrupt every processor that has the pmap active.

pmap_enter_quick_locked:

  Always set PTE_RO.

pmap_emulate_modified:

  Don't set PV_TABLE_REF.

  Eliminate a nonsensical comment.
2012-09-08 17:43:20 +00:00
Gleb Smirnoff
d6d3f01e0a Merge the projects/pf/head branch, that was worked on for last six months,
into head. The most significant achievements in the new code:

 o Fine grained locking, thus much better performance.
 o Fixes to many problems in pf, that were specific to FreeBSD port.

New code doesn't have that many ifdefs and much less OpenBSDisms, thus
is more attractive to our developers.

  Those interested in details, can browse through SVN log of the
projects/pf/head branch. And for reference, here is exact list of
revisions merged:

r232043, r232044, r232062, r232148, r232149, r232150, r232298, r232330,
r232332, r232340, r232386, r232390, r232391, r232605, r232655, r232656,
r232661, r232662, r232663, r232664, r232673, r232691, r233309, r233782,
r233829, r233830, r233834, r233835, r233836, r233865, r233866, r233868,
r233873, r234056, r234096, r234100, r234108, r234175, r234187, r234223,
r234271, r234272, r234282, r234307, r234309, r234382, r234384, r234456,
r234486, r234606, r234640, r234641, r234642, r234644, r234651, r235505,
r235506, r235535, r235605, r235606, r235826, r235991, r235993, r236168,
r236173, r236179, r236180, r236181, r236186, r236223, r236227, r236230,
r236252, r236254, r236298, r236299, r236300, r236301, r236397, r236398,
r236399, r236499, r236512, r236513, r236525, r236526, r236545, r236548,
r236553, r236554, r236556, r236557, r236561, r236570, r236630, r236672,
r236673, r236679, r236706, r236710, r236718, r237154, r237155, r237169,
r237314, r237363, r237364, r237368, r237369, r237376, r237440, r237442,
r237751, r237783, r237784, r237785, r237788, r237791, r238421, r238522,
r238523, r238524, r238525, r239173, r239186, r239644, r239652, r239661,
r239773, r240125, r240130, r240131, r240136, r240186, r240196, r240212.

I'd like to thank people who participated in early testing:

Tested by:	Florian Smeets <flo freebsd.org>
Tested by:	Chekaluk Vitaly <artemrts ukr.net>
Tested by:	Ben Wilber <ben desync.com>
Tested by:	Ian FREISLICH <ianf cloudseed.co.za>
2012-09-08 06:41:54 +00:00
Adrian Chadd
76af1a93c9 Correctly mask out the RTS/CTS flags when forming aggregates.
This had the side effect of clearing HAL_TXDESC_CLRDMASK for a bunch of
frames, meaning they'd end up being potentially filtered if there were
an error.  This is fine in the previous world as they'd just be
software retried but now that I'm working on filtered frames, these
descriptors would be endlessly retried until another valid frame would
come along that had CLRDMASK set.
2012-09-08 02:56:09 +00:00
Rui Paulo
de0af8d153 Add IRQ support to the resource list handling functions. 2012-09-08 01:26:52 +00:00
Matt Jacob
10bf42c215 Remove useless extra test.
Pointed out by:	Sascha of DragonFly BSD
MFC after:	2 weeks
2012-09-07 22:45:31 +00:00
Gleb Smirnoff
aaf6343576 Supply the pr_ctloutput method for local datagram sockets,
so that setsockopt() and getsockopt() work on them.

This makes 'tools/regression/sockets/unix_cmsg -t dgram'
more successful.
2012-09-07 21:06:54 +00:00
John Baldwin
ecbb462c38 Use callout(9) instead of timeout(9) to manage timers. 2012-09-07 19:42:36 +00:00
Xin LI
a8bc743735 It seems that what the code really meant is that when a write is completed,
do a BUS_DMASYNC_POSTWRITE over the DMA map.  The way it currently is would
only do POSTREAD for read transactions.

Submitted by:	Sascha Wildner
MFC after:	1 month
2012-09-07 19:00:27 +00:00
John Baldwin
51ba7b6f3e Remove remaining 4.x compat shims. No resulting changes (verified by
md5).
2012-09-07 18:41:19 +00:00
John Baldwin
773e3b7dda A few whitespace and comment fixes. 2012-09-07 15:10:46 +00:00
Fabien Thomas
35db642499 Complete and merge the list between Sandy/Ivy bridge of events
that can run on specific PMC.

MFC after:	1 month
2012-09-07 14:45:59 +00:00
Michael Tuexen
a169d6ec2b Don't include a structure containing a flexible array in another
structure.

MFC after:	10 days
2012-09-07 13:36:42 +00:00
Gavin Atkinson
915ae29a17 Prevent indent(1) from reformatting this comment, as it contains
a formatting-sensitive table.
2012-09-07 08:18:06 +00:00
Alan Cox
1fc6f326f3 Eliminate unnecessary NULL checks. 2012-09-07 06:12:28 +00:00
Alan Cox
b95d8becdb Eliminate an unused macro. 2012-09-07 01:33:25 +00:00
Adrian Chadd
2a9f83af64 Ensure that single-frame aggregate session frames are retransmitted
with the correct configuration.

Occasionally an aggregate TX would fail and the first frame would be
retransmitted as a non-AMPDU frame.  Since bfs_aggr=1 and bfs_nframes > 1
(from the previous AMPDU attempt), the aggr completion function would be
called and be very confused about what's going on.

Noticed by:	Kim <w8hdkim@gmail.com>
PR:		kern/171394
2012-09-07 00:24:27 +00:00
John Baldwin
30b5db9fea Dynamically allocate the S/G lists passed to callback routines rather than
allocating them on the stack of various bus_dmamap_load*() functions.  The
S/G lists are stored in the DMA tags.  This matches the implementation on
all other platforms.

Discussed with:	scottl, gibbs
Tested by:	stas (arm@)
2012-09-06 20:16:59 +00:00
John Baldwin
b9b256e49a Remove NetBSD compat shims for drivers originally shared with NetBSD/pc98.
NetBSD/pc98 was never merged into the main NetBSD tree and is no longer
developed.  Adding locking to these drivers would have made the compat
shims hard to impossible to maintain, so remove the shims to ease
future changes.

These changes were verified by md5.  Some additional shims can be removed
that do affect the compiled results that I will probably do in another
round.

Approved by:	nyan (tentatively)
2012-09-06 18:53:33 +00:00
John Baldwin
2a6ce61ae1 Add a kernel module on pc98 for the ct(4) driver. 2012-09-06 18:02:32 +00:00
Alan Cox
1e3510089f There is no need to release the pvh global lock around calls to
pmap_get_pv_entry().  In fact, some callers already held it around calls.
(In earlier versions, the same statements would apply to the page queues
lock.)

While I'm here tidy up the style of a few nearby statements and revise
some comments.

Tested by:	Ian Lepore
2012-09-06 16:26:04 +00:00
Fabien Thomas
1e862e5ad0 Add Intel Ivy Bridge support to hwpmc(9).
Update offcore RSP token for Sandy Bridge.
Note: No uncore support.

Will works on Family 6 Model 3a.

MFC after: 1 month
Tested by: bapt, grehan
2012-09-06 13:54:01 +00:00
Martin Matuska
1f3d1b1181 Make r230454 more readable and vendor-like.
PR:		kern/171380
MFC after:	3 days
2012-09-06 13:43:48 +00:00
Michael Tuexen
12780a595e Get rid of a gcc'ism.
MFC after: 10 days
2012-09-06 07:03:56 +00:00
Kevin Lo
3aa5b33a42 Add missing braces
Obtained from:	DragonFly
2012-09-06 02:07:58 +00:00
Gavin Atkinson
77c0749cb2 Add #defines for the bits in the PCI Express SLOT registers. Names
have been chosen based on the bit names in the PCI Express Base
Specification 3.0, and to match the predominant style of the existing
bit definitions.

MFC after:	1 week
2012-09-05 19:01:39 +00:00
Michael Tuexen
dd294dcec6 Using %p in a format string requires a void *.
MFC after: 10 days
2012-09-05 18:52:01 +00:00
Andrey Zonov
c4e357e8d3 - Simplify VM code by using vmspace_wired_count() for counting wired
memory of a process.

Reviewed by:	avg
Approved by:	kib (mentor)
MFC after:	2 weeks
2012-09-05 18:19:54 +00:00
Dimitry Andric
b8c0bcd29e After r240104, make sure the hpt27xx driver also compiles with clang,
when it is statically linked into the kernel.

MFC after:	2 weeks
X-MFC-With:	r240104
2012-09-05 17:13:08 +00:00
Brooks Davis
df201b82d3 Don't hardcode paths to MFS_IMAGE in the kernel config. When they don't
exist they don't cause "make tinderbox" to fail.

Reported by:	jhb
2012-09-05 15:55:51 +00:00
John Baldwin
1832280a9e - Explicitly call twe_done() to poll the hardware when looping in
twe_start() to simulate the behavior on 4.x where the driver dropped
  spl to allow interrupts to run to free up space in the command
  queue.  Be careful to only poll if we are going to make at least
  one more attempt to queue the current command.  Also, when polling,
  be careful to not call twe_startio() to queue more commands to avoid
  recursion.
- Move the buffer for formatting AEN messages into the softc instead of
  using a single driver-wide static buffer.

Requested by:	scottl (1)
Tested by:	Mike Tancsa @ Sentex
2012-09-05 14:31:58 +00:00
Konstantin Belousov
ef9461ba0e Add support for new Intel on-CPU Bull Mountain random number
generator, found on IvyBridge and supposedly later CPUs, accessible
with RDRAND instruction.

From the Intel whitepapers and articles about Bull Mountain, it seems
that we do not need to perform post-processing of RDRAND results, like
AES-encryption of the data with random IV and keys, which was done for
Padlock. Intel claims that sanitization is performed in hardware.

Make both Padlock and Bull Mountain random generators support code
covered by kernel config options, for the benefit of people who prefer
minimal kernels. Also add the tunables to disable hardware generator
even if detected.

Reviewed by:	markm, secteam (simon)
Tested by:	bapt, Michael Moll <kvedulv@kvedulv.de>
MFC after:	3 weeks
2012-09-05 13:18:51 +00:00
Dag-Erling Smørgrav
f379b823bc Whitespace cleanup. 2012-09-05 12:24:50 +00:00
Martin Matuska
4a24a25b2f Merge recent vendor changes and sync code:
1862 incremental zfs receive fails for sparse file > 8PB
3112 ztest does not honor ZFS_DEBUG
3122 zfs destroy filesystem should prefetch blocks
3129 'zpool reopen' restarts resilvers
3130 ztest failure: Assertion failed:
       0 == dmu_objset_destroy(name, B_FALSE) (0x0 == 0x10)

References:
  https://www.illumos.org/issues/1862
  https://www.illumos.org/issues/3112
  https://www.illumos.org/issues/3122
  https://www.illumos.org/issues/3129
  https://www.illumos.org/issues/3130

Obtained from:	illumos (vendor/illumos, vendor/illumos-sys)
MFC after:	2 weeks
2012-09-05 12:02:09 +00:00
Mike Silbersack
66437e8374 Only stop the BXE controller if it was first started. Stopping
an uninitialized controller can cause IPMI bus errors on some
systems.

Reviewed by:	yongari
Obtained from:	McAfee, Inc.
MFC after:	2 weeks
2012-09-05 06:51:28 +00:00
Alan Cox
d8f9ed32c5 Rename {_,}pmap_unwire_pte_hold() to {_,}pmap_unwire_ptp() and update the
comment describing them.  Both the function names and the comment had grown
stale.  Quite some time has passed since these pmap implementations last
used the page's hold count to track the number of valid mapping within a
page table page.  Also, returning TRUE from pmap_unwire_ptp() rather than
_pmap_unwire_ptp() eliminates a few instructions from callers like
pmap_enter_quick_locked() where pmap_unwire_ptp()'s return value is used
directly by a conditional statement.
2012-09-05 06:02:54 +00:00
Aleksandr Rybalko
1bccd8638e Style fixes.
Suggested by:   mdf
Approved by:	adrian (menthor)
2012-09-04 23:16:55 +00:00
Gavin Atkinson
5163813777 Support another uchcom(4) device.
MFC after:	1 week
2012-09-04 23:13:24 +00:00
Michael Tuexen
2899aa8f65 Use the consistenly the size of a variable. This helps to keep the code
simpler for the userland implementation.

MFC after: 3 days
2012-09-04 22:45:00 +00:00
Michael Tuexen
c6328f940e Whitespace change.
MFC after: 3 days
2012-09-04 22:40:49 +00:00
Dag-Erling Smørgrav
dc1b35b525 No memory barrier is required. This was pointed out by kib@ a while ago,
but I got distracted by other matters.

(for real this time)
2012-09-04 22:19:33 +00:00
Alexander V. Chernikov
73c23f3ba1 Fix the build broken by r240099.
Hide link_pfil_hook under _KERNEL macro.

MFC after:    3 weeks
2012-09-04 22:17:33 +00:00
Dag-Erling Smørgrav
22a5e6b972 Revert previous commit, which was performed in the wrong tree. 2012-09-04 21:06:53 +00:00
Xin LI
0807ad7422 Add hpt27xx to GENERIC kernel for amd64 and i386 systems.
MFC after:	2 weeks
2012-09-04 21:02:57 +00:00
Alexander V. Chernikov
7d4317bd40 Introduce new link-layer PFIL hook V_link_pfil_hook.
Merge ether_ipfw_chk() and part of bridge_pfil() into
unified ipfw_check_frame() function called by PFIL.
This change was suggested by rwatson? @ DevSummit.

Remove ipfw headers from ether/bridge code since they are unneeded now.

Note this thange introduce some (temporary) performance penalty since
PFIL read lock has to be acquired for every link-level packet.

MFC after:     3 weeks
2012-09-04 19:43:26 +00:00
John Baldwin
778eefa40d Fix duplicate entries for mwl(4):
- Move mwlfw from {amd64,i386}/conf/NOTES to sys/conf/NOTES (mwl(4) is
  already present in sys/conf/NOTES).
- Remove duplicate mwl(4) entries from {amd64,i386}/conf/NOTES.
- While here, add a description to the sfxge line in amd64/conf/NOTES.
2012-09-04 19:19:36 +00:00
Dag-Erling Smørgrav
db0390e833 No memory barrier is required. This was pointed out by kib@ a while ago,
but I got distracted by other matters.
2012-09-04 19:04:02 +00:00
Gleb Smirnoff
62208ca5d2 - Move jenkins.h to jenkins_hash.c
- Provide missing function that can do hashing of arbitrary sized buffer.
- Refetch lookup3.c and do only minimal edits to it, so that diff between
  our jenkins_hash.c and lookup3.c is minimal.
- Add declarations for jenkins_hash(), jenkins_hash32() to sys/hash.h.
- Document these functions in hash(9)

Obtained from:	http://burtleburtle.net/bob/c/lookup3.c
2012-09-04 12:07:33 +00:00
Alexander V. Chernikov
f340037ea1 Remove unneeded ipfw headers introduced in r213447 from Infiniband code.
MFC after:     2 weeks
2012-09-04 10:56:30 +00:00
Xin LI
dac366886e Update arcmsr(4) to vendor version 1.20.00.25.
Many thanks to Areca for continuing to support FreeBSD.

Submitted by:	Ching-Lung Huang <ching2048 areca com tw>
MFC after:	2 weeks
2012-09-04 05:15:54 +00:00
Hans Petter Selasky
aead9631e7 Add required USB AUDIO v2.0 structure definitions.
PR:	misc/171254
2012-09-03 19:17:25 +00:00
Hans Petter Selasky
f83fab0234 Add more DWC OTG register definitions.
Submitted by:	Nick Hudson
2012-09-03 15:22:02 +00:00
Gleb Smirnoff
478df1d534 Provide a sysctl switch that allows to install ARP entries
with multicast bit set. FreeBSD refuses to install such
entries since 9.0, and this broke installations running
Microsoft NLB, which are violating standards.

Tested by:	Tarasov Oleg <oleg_tarasov sg-tea.com>
2012-09-03 14:29:28 +00:00
Gleb Smirnoff
3582a9f6c6 Change bridge(4) to use if_transmit for forwarding packets to underlying
interfaces instead of queueing.

Tested by:	ray
2012-09-03 10:08:20 +00:00
Aleksandr Rybalko
6a8dada257 Add missing braces.
Approved by:	bschmidt (while mentor offline)
Pointed by:     gcooper
Pointy hat to:  ray
2012-09-03 09:46:46 +00:00
Andrey Zonov
cfe52ecf0e - After r240026 sgrowsiz should be used in a safer maner.
Approved by:	kib (mentor)
MCF after:	1 week
2012-09-03 09:34:46 +00:00
Andrey Zonov
ceb0f71506 - Mark some sysctls with CTLFLAG_TUN flag instead of CTLFLAG_RDTUN.
Pointed out by:	avg
Approved by:	kib (mentor)
MFC after:	1 week
2012-09-03 09:26:56 +00:00
Aleksandr Rybalko
70da14c4bb Add kern.hintmode sysctl variable to show current state of hints:
0 - loader hints in environment only;
1 - static hints only
2 - fallback mode (Dynamic KENV with fallback to kernel environment)
Add kern.hintmode write handler, accept only value 2. That will switch
static KENV to dynamic. So it will be possible to change device hints.

Approved by:	adrian (mentor)
2012-09-03 08:52:05 +00:00
Alan Cox
4cc8c59523 Correct an error in gxemul_disk_write(). It was issuing the command to
read from rather than write to the emulated disk.

Reviewed by:	jmallett
2012-09-03 02:32:00 +00:00
Pedro F. Giffuni
370c6ad8ce Fix RPC headers for C++
C++ mangling will cause trouble with variables like __rpc_xdr
in xdr.h so rename this to XDR.
While here add proper C++ guards to RPC headers.

PR:		137443
MFC after:	2 weeks
2012-09-02 21:04:40 +00:00
Andrey Zonov
c3927cd956 - Make kern.maxtsiz, kern.dfldsiz, kern.maxdsiz, kern.dflssiz, kern.maxssiz
and kern.sgrowsiz sysctls writable.

Approved by:	kib (mentor)
2012-09-02 17:39:02 +00:00
Dimitry Andric
917a07e1ab Partially revert r239959, after actually fixing most of the clang
warnings in sys/gnu/fs/xfs.  The only warnings that still need to be
suppressed are those about array bound overruns of flexible array
members in xfs_dir2_{block,sf}.c, which are too expensive (in terms of
cascading code changes) to fix.

MFC after:	1 week
X-MFC-With:	r239959
2012-09-02 14:46:18 +00:00
Michael Tuexen
81eb4e6351 Fix a typo which results in RTT to be off by a factor of 10, if the RTT is
larger than 1 second.

MFC after:	3 days
2012-09-02 12:37:30 +00:00
Mikolaj Golub
bb9f214f64 In soreceive_generic() remove the optimization for the case when
MSG_WAITALL is set, and it is possible to do the entire receive
operation at once if we block (resid <= hiwat). Actually it might make
the recv(2) with MSG_WAITALL flag get stuck when there is enough space
in the receiver buffer to satisfy the request but not enough to open
the window closed previously due to the buffer being full.

The issue can be reproduced using the following scenario:

On the sender side do 2 send(2) requests:

1) data of size much smaller than SOBUF_SIZE (e.g. SOBUF_SIZE / 10);
2) data of size equal to SOBUF_SIZE.

On the receiver side do 2 recv(2) requests with MSG_WAITALL flag set:

1) recv() data of SOBUF_SIZE / 10 size;
2) recv() data of SOBUF_SIZE size;

We totally fill the receiver buffer with one SOBUF_SIZE/10 size request
and partial SOBUF_SIZE request. When the first request is processed we
get SOBUF_SIZE/10 free space. It is just enough to receive the rest of
bytes for the second request, and soreceive_generic() blocks in the
part that is a subject of this change waiting for the rest. But the
window was closed when the buffer was filled and to avoid silly window
syndrome it opens only when available space is larger than sb_hiwat/4
or maxseg. So it is stuck and pending data is only sent via TCP window
probes.

Discussed with:	kib (long ago)
MFC after:	2 weeks
2012-09-02 07:33:52 +00:00
Mikolaj Golub
2ad099fcb1 In soreceive_generic() when checking if the type of mbuf has changed
check it for MT_CONTROL type too, otherwise the assertion
"m->m_type == MT_DATA" below may be triggered by the following scenario:

- the sender sends some data (MT_DATA) and then a file descriptor
  (MT_CONTROL);
- the receiver calls recv(2) with a MSG_WAITALL asking for data larger
  than the receive buffer (uio_resid > hiwat).

MFC after:	2 week
2012-09-02 07:29:37 +00:00
Adrian Chadd
be7f7a955b Disable strong signal diversity when enabling radar pulse detection
for the AR5212 era NICs.
2012-09-02 05:01:10 +00:00
Adrian Chadd
11f0fa784e AR5212 radar pulse fixes.
Fix the strong signal diversity capability setting - I had totally
messed up the indentation.

Set the default values to match what's in the .ini for now, rather than
what values I had previously gleaned from places.  This seems to work
quite well for the early AR5212 NICs I have.  Of course, later NICs
have different PHYs and the radar configuration is very card/board
dependent..

Tested:

 * ath1: AR5212 mac 5.3 RF5111 phy 4.1
   ath1: 2GHz radio: 0x0023; 5GHz radio: 0x0017

This detects 1, 5, 25, 50, 75, 100uS pulses reliably (with no interference.)

However, 10uS pulses don't detect reliably. That may be around the
transition between short and long pulses so some further tuning may
improve things.
2012-09-02 04:56:29 +00:00
Alan Cox
9b94d9eaab Calculate the new PTE value in pmap_enter() before acquiring any locks.
Move an assertion to the beginning of pmap_enter().
2012-09-02 04:39:07 +00:00
Eitan Adler
64baf9fbe0 Mark the ipfw interface type as not being ether. This fixes an issue
where uuidgen tried to obtain a ipfw device's mac address which was
    always zero.

    PR:		170460
    Submitted by:	wxs
    Reviewed by:	bdrewery
    Reviewed by:	delphij
    Approved by:	cperciva
    MFC after:	1 week
2012-09-01 23:33:49 +00:00
Pawel Jakub Dawidek
707641ec28 Fix panic in procdesc that can be triggered in the following scenario:
1. Process A pdfork(2)s process B.
2. Process A passes process descriptor of B to unrelated process C.
3. Hit CTRL+C to terminate process A. Process B is also terminated
   with SIGINT.
4. init(8) collects status of process B.
5. Process C closes process descriptor associated with process B.

When we have such order of events, init(8), by collecting status of
process B, will call procdesc_reap(). This function sets pd_proc to NULL.

Now when process C calls close on this process descriptor,
procdesc_close() is called. Unfortunately procdesc_close() assumes that
pd_proc points at a valid proc structure, but it was set to NULL earlier,
so the kernel panics.

The patch also adds setting 'p->p_procdesc' to NULL in procdesc_reap(),
which I think should be done.

MFC after:	1 week
2012-09-01 11:21:56 +00:00
Pawel Jakub Dawidek
769afdc71e Allow to pass providers with /dev/ prefix to g_provider_by_name().
MFC after:	3 days
2012-09-01 10:52:19 +00:00
Ed Schouten
4a8914c627 While there, remove an unneeded blank line.
MFC after:	1 month
2012-09-01 08:45:58 +00:00
Ed Schouten
ef42458103 Fix whitespace.
MFC after:	1 month
2012-09-01 08:45:19 +00:00
Rui Paulo
4685b7aabd The dtnfsclient module dependency should only be added if the old NFS
client support was compiled in.
2012-09-01 07:35:16 +00:00
Adrian Chadd
9c1b997551 Fix the PHY / CRC error bug in the AR5212 HAL, which apparently also pops
up on (at least) the AR5413.

The 30 second summary - if a CRC error frame comes in during PHY error
processing, that CRC bit will be set for all subsequent frames until
a non-CRC error frame is processed.

So to allow for accurate PHY error processing (Radar, and ANI on the AR5212
HAL chips) just tag the frame as being both CRC and PHY - let the driver
decide what to do with it.

PR:		kern/169362
2012-09-01 05:43:30 +00:00
Alan Cox
2d1f72d4b4 Introduce a new software PTE flag that indicates whether the mapping is
for a managed page.

Tested by:	jchandra
2012-09-01 03:46:28 +00:00
Pedro F. Giffuni
43981b6c53 Bring some changes from Bull's NFSv4 libtirpc implementation.
We especifically ignored the glibc compatibility changes
but this should help interaction with Solaris and Linux.
____

Fixed infinite loop in svc_run()
author	Steve Dickson
Tue, 10 Jun 2008 12:35:52 -0500 (13:35 -0400)
Fixed infinite loop in svc_run()
____

__rpc_taddr2uaddr_af() assumes the netbuf to always have a
non-zero data. This is a bad assumption and can lead to a
seg-fault. This patch adds a check for zero length and returns
NULL when found.
author	Steve Dickson
Mon, 27 Oct 2008 11:46:54 -0500 (12:46 -0400)
____

Changed clnt_spcreateerror() to return clearer
and more concise error messages.
author	Steve Dickson
Thu, 20 Nov 2008 08:55:31 -0500 (08:55 -0500)
____

Converted all uid and gid variables of the type uid_t and gid_t.
author	Steve Dickson
Wed, 28 Jan 2009 12:44:46 -0500 (12:44 -0500)
____

libtirpc: set r_netid and r_owner in __rpcb_findaddr_timed

These fields in the rpcbind GETADDR call are being passed uninitialized
to CLNT_CALL. In the case of x86_64 at least, this usually leads to a
segfault. On x86, it sometimes causes segfaults and other times causes
garbage to be sent on the wire.

rpcbind generally ignores the r_owner field for calls that come in over
the wire, so it really doesn't matter what we send in that slot. We just
need to send something. The reference implementation from Sun seems to
send a blank string. Have ours follow suit.
author	Jeff Layton
Fri, 13 Mar 2009 11:44:16 -0500 (12:44 -0400)
____

libtirpc: be sure to free cl_netid and cl_tp

When creating a client with clnt_tli_create, it uses strdup to copy
strings for these fields if nconf is passed in. clnt_dg_destroy frees
these strings already. Make sure clnt_vc_destroy frees them in the same
way.

author	Jeff Layton
Fri, 13 Mar 2009 11:47:36 -0500 (12:47 -0400)

Obtained from:	Bull GNU/Linux NFSv4 Project
MFC after:	3 weeks
2012-09-01 02:56:17 +00:00
Dimitry Andric
04b648fe23 Work around several warnings from clang in the xfs filesystem, when
linking it statically into the kernel.  With our gcc in base there are
no warnings, so also remove the WERROR= from the module makefile.

Noted by:	Eir Nym <eirnym@gmail.com>
MFC after:	1 week
2012-08-31 21:45:49 +00:00
John Baldwin
21056bd98b Similar to how r171350 fixed linking of kernel modules containing
firmware objects by adding --no-warn-mismatch to the linker flags,
add --no-warn-mismatch when linking firmware objects (*.fwo) as
well as to the link of the main kernel file.  This permits firmware
modules to be statically linked into an ia64 kernel.
2012-08-31 21:27:23 +00:00
John Baldwin
9c8a7771bb The implied source variable (.IMPSRC) didn't actually work in my previous
commit.  Change this to use .ALLSRC instead, but be careful to only use
the .fw file for NORMAL_FWO to ignore opt_global.h.
2012-08-31 21:10:38 +00:00
John Baldwin
3a45ae3c81 Add common rules for building firmware object files (NORMAL_FW to run
uudecode, and NORMAL_FWO to use ld to build the .fwo file) and use those
instead of explicit ld/uudecode invocations in sys/conf/files.  Apart from
increasing readability, this makes it possible to adjust the flags used for
firmware objects in one place.

MFC after:	2 weeks
2012-08-31 20:54:30 +00:00
Marius Strobl
9e8100e77c Add a global MD macro for the VIS block size instead of duplicating
it and using magic values all over the place.

MFC after:	1 week
2012-08-31 11:15:01 +00:00
Scott Long
cfc0969ad4 Heavily optimize the case of small RX packets of 160 bytes or less. For
this case, allocate a plain mbuf and copy the frame into it, then send the
copy up the stack, leaving the original mbuf+cluster in place in the
receive ring for immediate re-use.  This saves a trip through 2 of the
3 zones of the compound mbuf allocator, a trip through busdma, and a trip
through the 1 of the 3 mbuf destructors.  For our load at Netflix, this can
lower CPU consumption by as much as 20%.  The copy algorithm is based on
investigative work from Luigi Rizzo earlier in the year.

Reviewed by:	jfv
Obtained from:	Netflix
2012-08-31 10:07:38 +00:00
Scott Long
6aedf62f32 Essentially revert r239912. The amr_periodic function hadn't been armed in
over 10 years and was dead code; the previous revision exposed it as such to
CLANG.  The solution is to cull the whole thing.
2012-08-31 09:42:46 +00:00
Alan Cox
059fb00f23 Replace all uses of the vm page queues lock by a r/w lock that is private
to this pmap.

Tested by:	Ian Lepore
2012-08-31 02:59:44 +00:00
Attilio Rao
d4a2ab8c07 Post r222812 KTR_CPUMASK started being initialized only as a tunable
handler and not more statically.

Unfortunately, it seems that this is not ideal for new platform bringup
and boot low level development (which needs ktr_cpumask to be effective
before tunables can be setup).

Because of this, add a way to statically initialize cpusets, by passing
an list of initializers, divided by commas. Also, provide a way to enforce
an all-set mask, for above mentioned initializers.

This imposes some differences on how KTR_CPUMASK is setup now as a
kernel option, and in particular this makes the words specifications
backward wrt. what is currently in -CURRENT. In order to avoid mismatches
between KTR_CPUMASK definition and other way to setup the mask
(tunable, sysctl) and to print it, change the ordering how
cpusetobj_print() and cpusetobj_scan() acquire the words belonging
to the set.
Please give a look to sys/conf/NOTES in order to understand how the
new format is supposed to work.

Also, ktr manpages will be updated shortly by gjb which volountereed
for this.

This patch won't be merged because it changes a POLA (at least
from the theoretical standpoint) and this is however a patch that
proves to be effective only in development environments.

Requested by:	rpaulo
Reviewed by:	jeff, rpaulo
2012-08-30 21:22:47 +00:00
Oleksandr Tymoshenko
1b1a53cf46 Add barebone Raspberry Pi port. Supported parts:
- Interrupts controller
  - Watchdog
  - System timer
  - Framebuffer (hardcoded resolution/bpp)
2012-08-30 20:59:37 +00:00
Oleksandr Tymoshenko
f70f23cc3e Add PrimeCell UART (PL011) driver
Obtained from:	Semihalf
2012-08-30 20:31:53 +00:00
John Baldwin
ec9a9cf1e0 Attach interrupt handlers during attach instead of during the first time
the interface is brought up.  Without this, the boot time interrupt
round-robin assignment does not think the allocated interrupt resources
are active and leaves them assigned to CPU 0.

While here, add descriptive tags to each interrupt handler when MSI-X
is used.

Reviewed by:	np
MFC after:	1 week
2012-08-30 17:47:39 +00:00
John Baldwin
28435fb7f6 Use callout(9) rather than timeout(9). Note that the periodic timer in
amr(4) is never started, so this should be even more of a NOP than
normal.
2012-08-30 17:37:01 +00:00
Adrian Chadd
c0bf0c307c The DIR-825 cal data is in an odd spot. I don't know why it's here.
(This works on my board because I wrote new caldata into this spot;
but this obviously won't work for stock DIR-825 units out there.)
2012-08-30 17:35:12 +00:00
Hans Petter Selasky
710764f7c2 Preparations for adding USB HOST mode to the DWC OTG driver.
Merge register file with external one and put all register
definitions in a separate file.

Submitted by:	ray @
2012-08-30 16:19:05 +00:00
Alexander Motin
7d0ec9dd3f Add bunch of ATI HDMI HDA controller IDs.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	1 week
2012-08-30 15:47:20 +00:00
Alexander Motin
49a4a59a54 Add IDs for JMicron JMB360/JMB362 AHCI SATA controllers.
MFC after:	1 week
2012-08-30 15:23:59 +00:00
Gleb Smirnoff
3932d76033 In ifc_alloc_unit():
- In the !wildcard case, return ENOSPC instead of confusing EEXIST
  in case if ifc->ifc_maxunit reached.
- Fix unit leak, that I've introduced in previous revision.

Submitted by:	Daan Vreeken <Daan vitsch.nl>
2012-08-30 12:18:45 +00:00
Andrey Zonov
e145130e71 - Remove accounting of locked memory from vsunlock(9) that I missed in r239818.
Approved by:	kib (mentor)
2012-08-30 08:03:33 +00:00
Adrian Chadd
dae1b5d00a Migrate the AR9285 diversity configuration LNA configuration to use
some HAL definitions rather than local definitions.

The original source (ath9k) pulled this stuff from the QCA driver and
removed the HAL_* prefix.  I'm just restoring the correct order of things.

Obtained from:	Qualcomm Atheros
2012-08-30 06:55:47 +00:00
Jim Harris
a099c5cca0 Do not call sati_check_data_io() for SATI_UNMAP sequences.
This routine is intended only for commands such as INQUIRY where
the controller may fill out a smaller amount of data than allocated
by the host.

The end result of this bug was that isci(4) would report non-zero
resid for successful SCSI_UNMAP commands.

Sponsored by:	Intel
MFC after:	3 days
2012-08-30 00:43:14 +00:00
Adrian Chadd
5a7bc717f0 More attempts at space saving.
* add cam as a module to build - but build in scbus/da for now, as
  "cam" as a module includes all cam devices. Hardly space saving.
* Don't build FFS snapshot support.
2012-08-29 22:58:52 +00:00
Dimitry Andric
9a6a13d687 After r239868, also remove the comment about the workaround for
ah_eeprom_9287.c.
2012-08-29 18:58:03 +00:00
Dimitry Andric
7b4806d69f Remove the argument-less .align directive in sys/i386/bios/smapi_bios.S.
Specifying no argument is undocumented in the gas manual, and clang's
integrated assembler refuses to parse it.  Also, removing it causes no
change at all in the resulting object file.

MFC after:	1 week
2012-08-29 18:22:52 +00:00
Dimitry Andric
5e34d6ba62 Remove workaround for the clang 3.2 warning in ah_eeprom_9287.c, since
the fix has been applied now.
2012-08-29 18:14:20 +00:00
Adrian Chadd
fb20fd244e There's no nede to allocate a DMA map just before calling bus_dmamem_alloc().
In fact, bus_dmamem_alloc() happily NULLs the dmat pointer passed in,
before replacing it with its own.

This fixes a MIPS crash when kldload'ing if_ath/if_ath_pci -
bus_dmamap_destroy() was passed in a NULL dmat pointer and was doing
all kinds of very bad things.

Reviewed by:	scottl
2012-08-29 16:58:51 +00:00
Marius Strobl
bf38cf8ab3 - Unlike cache invalidation and TLB demapping IPIs, reading registers from
other CPUs doesn't require locking so get rid of it. As the latter is used
  for the timecounter on certain machine models, using a spin lock in this
  case can lead to a deadlock with the upcoming callout(9) rework.
- Merge r134227/r167250 from x86:
  Avoid cross-IPI SMP deadlock by using the smp_ipi_mtx spin lock not only
  for smp_rendezvous_cpus() but also for the MD cache invalidation and TLB
  demapping IPIs.
- Mark some unused function arguments as such.

MFC after:	1 week
2012-08-29 16:56:50 +00:00
Andrey Zonov
126a63ce6c - Don't take an account of locked memory for current process in vslock(9).
There are two consumers of vslock(9): sysctl code and drm driver.  These
consumers are using locked memory as transient memory, it doesn't belong
to a process's memory.

Suggested by:	avg
Reviewed by:	alc
Approved by:	kib (mentor)
MFC after:	2 weeks
2012-08-29 11:23:59 +00:00
Warner Losh
863d605966 4-wire mode isn't working quite right, so turn it off for a bit. 2012-08-29 06:43:28 +00:00
Warner Losh
f22f156e0b Make this work on the AT91SAM9G20:
o Disable multi-block operations: they sometimes fail.
o Don't use the PROOF bits yet: they hang the system hard.
o Disable the the multi-block operations for !rm9200, but it
  still doesn't help.
o Fix writing < 12 bytes errata to actually work.
o Enable, for the moment, reporting extra bytes soaked up.
2012-08-29 06:42:39 +00:00
Warner Losh
683bb97c9f When copying data, use memcpy instead of bcopy. It matches the
arguments better.
Also, set the need to use the workaround flag before we actually need
to use it, rather than after.
2012-08-29 04:41:25 +00:00
Adrian Chadd
28bb46617d Set the HAL combined antenna diversity capability if the AR9285
EEPROM settings allow it.
2012-08-29 04:11:00 +00:00
Adrian Chadd
46e2649633 Add a new capability bit - whether the hardware supports AR9285 style
combined diversity.
2012-08-29 04:09:54 +00:00
Adrian Chadd
d6af4e0f06 Add AR5413 radar parameters and strong signal diversity capability.
This is a re-implementation based on the reference carrier code
for the AR5413.

Tested:
 * Pulse detection for AR5212 and AR5413, to ensure the
   correct behaviour for both chips

PR:		kern/170904
Obtained from:	Qualcomm Atheros
2012-08-29 03:58:13 +00:00
Adrian Chadd
0146ef1ae2 Add a (temporarily located) definition. 2012-08-29 03:50:59 +00:00
Adrian Chadd
f01591cccf Bring over a configuration for the Atheros AP91 reference board.
This has an AR7240 SoC with an AR9285 wireless NIC on-board.

Since the kernel partition on the 4MiB flash is 960KiB, quite a bit
is disabled to try and squeeze the build into that.  Even lzma'ed,
it's still quite large.
2012-08-29 01:08:36 +00:00
Adrian Chadd
21cb20bb94 Remove - not needed. 2012-08-29 00:53:58 +00:00
Adrian Chadd
b5c5592d2b Remove extra debugging - there's no longer any need. 2012-08-29 00:53:41 +00:00
Adrian Chadd
1396b8ddd1 * Don't compile in sysctl descriptions
* random is fine as a module
2012-08-28 22:50:47 +00:00
Adrian Chadd
8a1e4fa08b Add a new flash part - 4MB SPI flash from Winbond. 2012-08-28 22:17:22 +00:00
Ed Schouten
fa4dd27847 Remove unused SI_* flags.
The SI_DEVOPEN, SI_CONSOPEN and SI_CANDELETE flags are not used by any
piece of code in the tree.
2012-08-28 19:30:29 +00:00
Ed Schouten
24d1105dde Remove unneeded G_PF_CANDELETE flag.
This flag is only used by GEOM so it can be propagated to the character
device's SI_CANDELETE. Unfortunately, SI_CANDELETE seems to do nothing.
2012-08-28 19:28:31 +00:00
Ed Schouten
3f0fb35417 Use a proper destructor function.
When calling a revoke(2) on a dtrace device, dtrace_close() could be
called, even if threads are still stuck in the device. Defer the actual
deallocation of datastructures to the cdevpriv destructor.

While there, remove the unneeded D_TRACKCLOSE and D_NEEDMINOR flags. For
the helper device, we never need it. For the regular dtrace devices, we
only need these flags on FreeBSD pre-8.

MFC after:	1 month
2012-08-28 18:33:12 +00:00
Warner Losh
062223cd29 Make AT91_MCI_ALLOW_OVERCLOCK a real option. Rename old use 30MHz to
this new option.  Only try to use > 25MHz when our best frequency is <
15MHz and overclocking is enabled. Fix minor style chaff.
2012-08-28 17:27:46 +00:00
Warner Losh
d7f8f1facd Clip the upper end to 31MHz for slow clock speeds. On faster
machines, we wind up with a 66MHz clock, which is too fast.
2012-08-28 14:19:10 +00:00