MFC r251482,251733:
r251482:
Correct setting TX random backoff register. This register is
implemented as a 10 bits linear feedback shift register so only
lower 10 bits are valid.
Because this register is used to initialize random backoff interval
register only when resolved duplex is half-duplex, it wouldn't have
caused issues in these days.
r251733:
Fix a typo introduced in r213280. IFM_OPTIONS macro should see
current media word.
MFC r251481:
Do not report current link status if driver is not running.
Reporting link status in driver has a side-effect that makes mii(4)
check current link status. mii(4) will call link status change
callback when it sees link state change. Normally this wouldn't
have problems. However, ASF/IPMI firmware can actively access PHY
regardless of driver's running state such that reporting link
status for not-running interface can generate meaningless link
UP/DOWN messages.
This change also makes dhclient think driver got a valid link
regardless of link establishment so it will bypass dhclient's
initial link status check. I think that wouldn't be issue
though.
MFC r252143:
When RX checksum offloading is active, AX88772B will prepend a
checksum header. The header contains a received frame length but
the defined length for AX88772B is different with other ASIX
controllers. When the RX checksum is off, AX88772B controller does
not prepend a checksum header so driver has to use normal header
length mask.
This change should fix RX errors when RX checksum offloading is
off.
lstewart [Sat, 29 Jun 2013 04:25:40 +0000 (04:25 +0000)]
MFC r251887:
Add new FOREACH_FROM variants of the queue(3) FOREACH macros which can
optionally start the traversal from a previously found element by passing the
element in as "var". Passing a NULL "var" retains the same semantics as the
regular FOREACH macros.
jhb [Fri, 28 Jun 2013 18:25:04 +0000 (18:25 +0000)]
MFC 252205:
If daily_status_security_inline is set, the rc value needs to be
forced to 3 so that the output of this script is always displayed.
In fact, setting this flag is identical to setting
daily_status_security_output to an empty string. To make the logic
less confusing, change the behavior of daily_status_security_inline
such that it just forces daily_status_security_output to an empty
string and then applies the normal logic.
jhb [Fri, 28 Jun 2013 16:07:20 +0000 (16:07 +0000)]
MFC 246120,246148,246206,246587,247411,247415:
Add fmemopen(3), open_memstream(3), and open_wmemstream(3) which provide
stdio FILE objects for memory buffers.
lstewart [Fri, 28 Jun 2013 03:39:54 +0000 (03:39 +0000)]
MFC r251725:
Fix a potential NULL-pointer dereference that would trigger if the hhook
registration site did not provide storage for a copy of the hhook_head struct.
jhb [Thu, 27 Jun 2013 20:35:39 +0000 (20:35 +0000)]
MFC 250418,252166:
Revision 233677 broke certain machines. Specifically, if the firmware/BIOS
assigned conflicting ranges to BARs then leaving the BARs alone could
result in one device stealing mmio accesses intended to go to a second
device. Prior to 233677 the PCI bus driver attempted to handle this case
by clearing the BAR to 0 depending on BARs based at 0 not decoding (which
is not guaranteed to be true). Now when a conflicting BAR is detected the
following steps are taken:
1) If hw.pci.realloc_bars (a new tunable) is enabled (default is disabled),
then ignore the current BAR setting from the firmware and attempt to
allocate a fresh resource range for the BAR.
2) If 1) failed (or was disabled), disable decoding for the relevant
BAR type (e.g. disable mem decoding for a memory BAR) and emit a
warning if booting verbose.
delphij [Thu, 27 Jun 2013 17:33:04 +0000 (17:33 +0000)]
Fix build: in a recent pf refactor (head@240233), pf_var.h was modified
to not include netinet/tcp_fsm.h, and HEAD tcpdump rely on this change
as the tcp_fsm.h will only be processed once.
Solve this by defining TCPSTATES earlier. This wouldn't cause breakage
should pf be merged in the future.
Noticed by: tinderbox via many
Pointy hat to: delphij
gjb [Thu, 27 Jun 2013 13:03:19 +0000 (13:03 +0000)]
MFC r230786, r246283, r251084, r251085, r251086:
r230786 (imp):
- Allow specification of build shell for the buildenv target.
r246283 (hrs) (partial):
- Add {WORLD,KERNEL}_FLAGS to [BTWK]MAKE.
r251084:
- r245757 introduced warning output if update method is set to
CVS_UPDATE or SUP_UPDATE.
- CVS exporter for stable/9/ is turned off for nearly one month
now.
- It is finally time to swing the ax at these update methods.
r251085:
- Fix typo introduced in r251084.
r251086:
- Remove references to CVS_UPDATE and SUP_UPDATE to catch up
with r251084.
marius [Thu, 27 Jun 2013 09:30:09 +0000 (09:30 +0000)]
MFC: r252180
Flag mpt(4) as supporting unmapped I/O; all necessary conversion actually
already has been done as part of r246713 (MFCed to stable/9 in r251874)
except for a comment update.
marius [Thu, 27 Jun 2013 09:23:53 +0000 (09:23 +0000)]
MFC: r251715
All of Oxford/PLX OX16PCI954, OXm16PCI954 and OXu16PCI954 share the
exact same (subsystem) device and vendor IDs. However, the reference
design for the OXu16PCI954 uses a 14.7456 MHz clock (as does the EXSYS
EX-41098-2 equipped with these), while at least the OX16PCI954 defaults
to a 1.8432 MHz one. According to the datasheets of these chips, the
only difference in PCI configuration space is that OXu16PCI954 have
a revision ID of 1 while the other two are at 0. So employ the latter
for determining the default clock rates of this family.
marius [Thu, 27 Jun 2013 09:21:22 +0000 (09:21 +0000)]
MFC: r248472
Correct the definition for Exar XR17V258IV: we must use a config_function
to specify the offset into the PCI memory spare at which each serial port
will find its registers. This was already done for other Exar PCI serial
devices; it was accidentally omitted for this specific device.
marius [Thu, 27 Jun 2013 09:14:50 +0000 (09:14 +0000)]
MFC: r251589
- The method introduced as part of r234898 (MFCed to stable/9 in r236076)
for not altering the boot path when booting from ZFS turned out to also
cause the boot path not being adjusted if booting from CD-ROM with firmware
versions that do not employ the "cdrom" alias in that case. So shuffle the
code around instead in order to achieve the original intent. Ideally, we
shouldn't fiddle with the boot path when booting from UFS on a disk either;
unfortunately, there doesn't seem to be an universal way of telling disks
and CD-ROMs apart, though. [1]
- Use NULL instead of 0 for pointers.
kib [Thu, 27 Jun 2013 07:27:08 +0000 (07:27 +0000)]
MFC r251684:
Fix two issues with the spin loops in the umtx(2) implementation.
- When looping, check for the pending suspension.
- Add missed checks for the faults from casuword*().
- Replace the beerware license on mdconfig(8) with standard 2-clause BSD.
- Rewrite option parsing in mdconfig(8). This makes it more user-friendly
by removing the ordering requirements and adding more descriptive error
messages; it also makes it more readable and maintainable.
- Add "-f file" support to listing mode (-l). When a -f option is
specified, only md(4) devices which have the specified file as backing
store are displayed.
- Use MD_NAME instead of "md".
- Use _PATH_DEV instead of "/dev/".
- Return -1 when the specified backing store file is not found in the md
device list.
pfg [Wed, 26 Jun 2013 04:34:16 +0000 (04:34 +0000)]
MFC r252103:
Define and use e2fs_lbn_t in ext2fs.
In line to what is done in UFS, define an internal type
e2fs_lbn_t for the logical block numbers.
This change is basically a no-op as the new type is unchanged
(int32_t) but it may be useful as bumping this may be required
for ext4fs.
Also, as pointed out by Bruce Evans:
-Use daddr_t for daddr in ext2_bmaparray(). This seems to
improve reliability with the reallocblks option.
- Add a cast to the fsbtodb() macro as in UFS.
gjb [Wed, 26 Jun 2013 00:38:40 +0000 (00:38 +0000)]
MFC r251652, r251811, r252101:
r251652:
Add new script to run release builds. The script is heavily based upon
the release/generate-release.sh script by nwhitehorn.
This script can use optional configuration file to override defaults,
making running multiple serialzied builds with different specific
configurations or architecture-specific tunings quite easy.
Sample overrideable options are included in the release.conf.sample
file.
r251811:
Fix OSVERSION variable within PBUILD_FLAGS.
r252101:
If MAKE_CONF and/or SRC_CONF are set and not character devices,
copy to chroot to use with release build.
jimharris [Tue, 25 Jun 2013 23:30:48 +0000 (23:30 +0000)]
MFC r240616, r240619, r240620:
Merge initial NVM Express (NVMe) commits to stable/9.
This only pulls the nvme(4), nvd(4) and nvmecontrol(8) code into stable/9.
A follow-up commit will link it into the build and merge all of the
additional commits made for NVMe over the last few months.
ken [Tue, 25 Jun 2013 21:43:49 +0000 (21:43 +0000)]
MFC: 249658, 249701
Update chio(1) and ch(4) to support reporting element designators.
This allows mapping a tape drive in a changer (as reported by
'chio status') to a sa(4) driver instance by comparing the
serial numbers.
The designators can be ASCII (which is printed out directly), binary
(which is printed in hex format) or UTF-8, which is printed in either
native UTF-8 format if the terminal can support it, or in %XX notation
for non-ASCII characters. Thanks to Hiroki Sato <hrs@> for the
explanation and example UTF-8 printing code.
chio.h: Modify the changer_element_status structure to add new
fields and definitions from the SMC3r16 spec.
Rename the original CHIOGSTATUS ioctl to OCHIOGTATUS and
define a new CHIOGSTATUS ioctl.
Clean up some tab/space issues.
chio.c: For the 'status' subcommand, print the designator field
if it is supplied by a device.
scsi_ch.h: Add new flags for DVCID and CURDATA to the READ
ELEMENT STATUS command structure.
Add a read_element_status_device_id structure
for the data fields in the new standard. Add new
unions, dt_or_obsolete and voltage_devid, to hold
and address data from either SCSI-2 or newer devices.
scsi_ch.c: Implement support for fetching device IDs with READ
ELEMENT STATUS data.
Add new arguments to scsi_read_element_status() to
allow the user to request the DVCID and CURDATA bits.
This isn't compiled into libcam (it's only an internal
kernel interface), so we don't need any special
handling for the API change.
If the user issues the new CHIOGSTATUS ioctl, copy all of
the available element status data out. If he issues the
OCHIOGSTATUS ioctl, we don't copy the new fields in the
structure.
Fix a bug in chopen() that would result in the peripheral
never getting unheld if chgetparams() failed.
mav [Tue, 25 Jun 2013 07:32:49 +0000 (07:32 +0000)]
MFC r249980:
Give periph validity flag own periph reference. That slightly simplifies
the release logic and covers hypothetical case if lock is dropped inside
the periph_oninval() method.
mav [Tue, 25 Jun 2013 07:27:23 +0000 (07:27 +0000)]
MFC r251792:
Restore use of polling mode for disk cache flush in case of kernel panic.
While I am not sure that any extra hardware access is a good idea after
panic, that is an existing behaviour that should better work correctly.
mav [Tue, 25 Jun 2013 07:17:10 +0000 (07:17 +0000)]
MFC r251743:
Improve firmware download status check. Previous check was insufficient for
ATA since it ignored transport errors like command timeouts, while for SCSI
it was just wrong.
mckusick [Mon, 24 Jun 2013 23:41:16 +0000 (23:41 +0000)]
MFC of 250891, 250892, 250894, 250895, 250897, and 250901
MFC 250891:
Properly spell sentinel (not sintenel or sentinal).
No functional changes.
Spotted by: kib
MFC 250892:
Remove a bogus check for a NULL buffer pointer.
Add a KASSERT that it is not NULL.
Found by: Coverity Scan, CID 1009114
Reviewed by: kib
MFC 250894:
Null a pointer after it is freed so that when it is returned
the return value is NULL. Based on the returned flags, the
return value should never be inspected in the case where NULL
is returned, but it is good coding practice not to return a
pointer to freed memory.
Found by: Coverity Scan, CID 1006096
Reviewed by: kib
MFC 250895:
Add missing 28th element to softdep types name array.
Found by: Coverity Scan, CID 1007621
Reviewed by: kib
MFC 250897:
Add missing buffer releases (brelse) after bread calls that return
an error. One could argue that returning a buffer even when it is
not valid is incorrect, but bread has always returned a buffer
valid or not.
Reviewed by: kib
MFC 250901:
Properly spell sentinel (missed in 250891)
No functional changes.
jhb [Mon, 24 Jun 2013 18:27:44 +0000 (18:27 +0000)]
MFC 251470:
Do not compare the existing mask of a cpuset with a new mask when changing
the mask of a cpuset. Also, change the cpuset's mask before updating the
masks of all children. Previously changing a cpuset's mask first required
setting the mask to a super-set of both the old and new masks and then
changing it a second time to the new mask.
jhb [Mon, 24 Jun 2013 16:04:59 +0000 (16:04 +0000)]
MFC 250223,250233:
Similar to 233760 and 236717, export some more useful info about the
kernel-based POSIX semaphore descriptors to userland via procstat(1) and
fstat(1):
- Change sem file descriptors to track the pathname they are associated
with and add a ksem_info() method to copy the path out to a
caller-supplied buffer.
- Use the fo_stat() method of shared memory objects and ksem_info() to
export the path, mode, and value of a semaphore via struct kinfo_file.
- Add a struct semstat to the libprocstat(3) interface along with a
procstat_get_sem_info() to export the mode and value of a semaphore.
- Teach fstat about semaphores and to display their path, mode, and value.
glebius [Mon, 24 Jun 2013 09:25:38 +0000 (09:25 +0000)]
Merge r248159:
Fix for quite a special case when userland emulates a netgraph node, and
userland can reply to a message with NGM_HASREPLY bit set. In this case
we should not wait for a response to a responce.
PR: 176771
Submitted by: Keith Reynolds <keith.reynolds tidalscale.com>
glebius [Mon, 24 Jun 2013 08:55:20 +0000 (08:55 +0000)]
Merge r243151:
o Remove meaningless PROTOCOLS section.
o Describe passing file descriptors as separate section.
- Descriptors can be passed through any protocol of the UNIX family,
not SOCK_STREAM and SOCK_SEQPACKET only. [1]
o Describe socket options as separate section.
- Move LOCAL_PEERCRED option to this section.
- Describe struct xucred.
- In LOCAL_CREDS section mention that credentials
are passed only on the first read on non-datagram
sockets.
o Xref all mentioned system calls.
delphij [Mon, 24 Jun 2013 05:00:31 +0000 (05:00 +0000)]
MFC r251478: MFV r251474:
* Illumos zfs issue #3137 L2ARC compression
Whether or not to compress buffers entering the L2ARC is
controlled by "compression" setting on the dataset, when
compression is not "off", L2ARC compression is enabled.
The compress method is always LZ4 for L2ARC when enabled
because it works best for the scenario.
pfg [Sat, 22 Jun 2013 21:31:59 +0000 (21:31 +0000)]
MFC r251809, r251952, r252012:
Re-sort ext2fs headers to make things easier to find.
In the ext2fs driver we have a mixture of headers:
- The ext2_ prefixed headers have strong influence from NetBSD
and are carry specific ext2/3/4 information.
- The unprefixed headers are inspired on UFS and carry implementation
specific information.
Do some small adjustments so that the information is easier to
find coming from either UFS or the NetBSD implementation.
Also
- Set MAXMNTLEN nearer to where it is used.
- Move EXT2_LINK_MAX to ext2_dir.h .
- Rename some prefixes in the Block Group Descriptor fields.
markj [Sat, 22 Jun 2013 05:32:11 +0000 (05:32 +0000)]
MFC r250599:
Add a remark to the effect that a manually started relearn will always
result in the battery being completely drained, even in transparent learning
mode.
markj [Sat, 22 Jun 2013 05:24:29 +0000 (05:24 +0000)]
MFC r246951:
Mark the coretemp(4) sysctls as MPSAFE, ensuring that Giant won't be held
unnecessarily by a user thread waiting to run on a specific CPU after
calling sched_bind().
markj [Sat, 22 Jun 2013 04:50:25 +0000 (04:50 +0000)]
MFC r251166:
Add macros which allow one to define SDT probes with six or seven arguments;
they are needed when porting some of the Solaris providers (ip, iscsi, and
tcp in particular).
dtrace_probe() only takes five arguments from the probe site, so we need to
add the appropriate cast to allow for more than five arguments. The extra
arguments are later copied out of dtrace_probe()'s stack frame by
dtrace_getarg() (or the provider-specific getarg method) as needed.
pfg [Sat, 22 Jun 2013 02:22:12 +0000 (02:22 +0000)]
MFC r251212, r251480:
GCC: bring back experimental support for amdfam10/barcelona CPUs.
This is a revised subset of the support initially brought in in r236962
and later reverted. The collateral efects seem to have disappeared but
it is still recommended to set the CPUTYPE with caution.
While here also install AMD intrinsics header ammintrin.h
gnn [Fri, 21 Jun 2013 21:38:48 +0000 (21:38 +0000)]
MFC: 249514
Point args[0] not at the thread that is ending but at the one that
is starting. This is in line with practice in OpenSolaris.
Note that this change is only in ULE and not in the 4BSD scheduler.
Once this change settles in (MFC timeout has expired) we'll try it out
on 4BSD as well.
rmacklem [Fri, 21 Jun 2013 20:16:41 +0000 (20:16 +0000)]
MFC: r251444, r251476
Add a "-v" (verbose) option to the gssd daemon, to help
with diagnosis of kerberized NFS mount problems. When set,
messages are sent to syslog() (or fprintf(stderr,...) if
"-d" is also specified) to indicate activity/results of
kgssapi upcalls.
jhb [Fri, 21 Jun 2013 19:28:58 +0000 (19:28 +0000)]
MFC 251637:
Borrow the algorithm from kvm_getprocs() to fix procstat_getprocs() to
handle the case where the process tables grows in between the calls to
fetch the size and fetch the table.
jhb [Thu, 20 Jun 2013 19:56:26 +0000 (19:56 +0000)]
MFC 251617:
Store a reference to the vnode associated with a file descriptor in the
linux_file structure and use it instead of directly accessing td_fpop
when destroying the linux_file structure. The td_fpop pointer is not
valid when a cdevpriv destructor is run, and the type-specific close
method has already been called, so f_vnode may not be valid (and the
vnode might have been recycled without our own reference).
gahr [Thu, 20 Jun 2013 16:51:25 +0000 (16:51 +0000)]
MFC: r249406
- Do not bail out if stat(2) fails with ENOENT in the spool directory. This
happens if another atrm process removes a job while we're scanning through
the directory.
- While at it, optimize a bit the directory scanning, so that we quit
looping as soon as all jobs specified in argv have been dealt with.