]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agosfxge: add prefast annotation to common code return types
Andrew Rybchenko [Sun, 29 Nov 2015 05:42:49 +0000 (05:42 +0000)]
sfxge: add prefast annotation to common code return types

Using a typedef for common code return types (rather than "int")
allows the Prefast static analyser to understand when a function
has been successful (and thus when its postconditions must hold).

This greatly reduces then number of false positives reported by
prefast for error paths in common code functions.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agou32 -> uint32_t.
Adrian Chadd [Sun, 29 Nov 2015 05:42:18 +0000 (05:42 +0000)]
u32 -> uint32_t.

8 years agosfxge: cleanup: fix prefast annotations on mac stats updates
Andrew Rybchenko [Sun, 29 Nov 2015 05:38:40 +0000 (05:38 +0000)]
sfxge: cleanup: fix prefast annotations on mac stats updates

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
X-MFC with:     r291397

8 years ago[ath_hal] add AR9461 (jupiter) 2.1 support.
Adrian Chadd [Sun, 29 Nov 2015 05:34:00 +0000 (05:34 +0000)]
[ath_hal] add AR9461 (jupiter) 2.1 support.

Obtained from: Linux ath9k

8 years agosfxge: modify nvram update functions for uio platform to support RFID-selectable...
Andrew Rybchenko [Sun, 29 Nov 2015 05:08:23 +0000 (05:08 +0000)]
sfxge: modify nvram update functions for uio platform to support RFID-selectable presets

Dynamic config partitions on boards that support RFID are divided into
a number of segments, each formatted like a partition, with header,
trailer and end tags. The first segment is the current active
configuration.

The segments are initialised by manftest and each contain a different
configuration e.g. firmware variant. The firmware can be instructed
via RFID to copy a segment over the first segment, hence changing the
active configuration. This allows ops to change the configuration of
a board prior to shipment using RFID.

Changes to the dynamic config may need to be written to all segments (in
particular firmware versions written by manftest) or just the first
segment (changes to the active configuration). See SF-111324-SW.
If only the first segment is written the code still needs to be aware of
the possible presence of subsequent segments as writing to a segment may
cause its size to increase, which would overwrite the subsequent
segments and invalidate them.

Boards that do not support RFID will only have one segment in their
dynamic config partition.

Submitted by:   Paul Fox <pfox at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4302

8 years agodrm/i915: Reduce diff with Linux 3.8
Jean-Sébastien Pédron [Sat, 28 Nov 2015 17:38:27 +0000 (17:38 +0000)]
drm/i915: Reduce diff with Linux 3.8

There is no functional change. The goal is to ease the future update to
Linux 3.8's i915 driver.

MFC after: 2 months

8 years agodrm/i915: Further reduce the diff in i915_dma.c
Jean-Sébastien Pédron [Sat, 28 Nov 2015 17:37:41 +0000 (17:37 +0000)]
drm/i915: Further reduce the diff in i915_dma.c

MFC after: 2 months

8 years agodrm/i915: Reduce diff with Linux 3.8
Jean-Sébastien Pédron [Sat, 28 Nov 2015 15:22:46 +0000 (15:22 +0000)]
drm/i915: Reduce diff with Linux 3.8

There is no functional change. The goal is to ease the future update to
Linux 3.8's i915 driver.

MFC after: 2 months

8 years agoAHCI: Use bus_dmamap_sync(9) when accessing DMA buffers.
Michal Meloun [Sat, 28 Nov 2015 14:30:42 +0000 (14:30 +0000)]
AHCI: Use bus_dmamap_sync(9) when accessing DMA buffers.

Reviewed by: mav
Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D4240

8 years agoARM: Implement atomic_swap_int(9). It's used in DRM2 code.
Michal Meloun [Sat, 28 Nov 2015 12:12:28 +0000 (12:12 +0000)]
ARM: Implement atomic_swap_int(9). It's used in DRM2 code.

Approved by: kib (mentor)

8 years agoARM: Add support for new KRAIT 300 CPU revision.
Michal Meloun [Sat, 28 Nov 2015 12:11:44 +0000 (12:11 +0000)]
ARM: Add support for new KRAIT 300 CPU revision.

Approved by: kib (mentor)

8 years agoARM: Cumulative fixes for GIC
Michal Meloun [Sat, 28 Nov 2015 12:09:36 +0000 (12:09 +0000)]
ARM: Cumulative fixes for GIC
 - fix detection of interrupt root controller
 - allow (but warn) unsupported configuration bits
 - dont send EOI for spurious interrupts
 - print more informations for spurious interrupts
 - use device_printf() where appropriate

Reviewed by: ian (earlier version)
Approved by: kib (mentor)

8 years agoRemove sv_prepsyscall, sv_sigsize and sv_sigtbl members of the struct
Konstantin Belousov [Sat, 28 Nov 2015 08:49:07 +0000 (08:49 +0000)]
Remove sv_prepsyscall, sv_sigsize and sv_sigtbl members of the struct
sysent.

sv_prepsyscall is unused.

sv_sigsize and sv_sigtbl translate signal number from the FreeBSD
namespace into the ABI domain.  It is only utilized on i386 for iBCS2
binaries.  The issue with this approach is that signals for iBCS2 were
delivered with the FreeBSD signal frame layout, which does not follow
iBCS2.  The same note is true for any other potential user if
sv_sigtbl.  In other words, if ABI needs signal number translation, it
really needs custom sv_sendsig method instead.

Sponsored by: The FreeBSD Foundation

8 years agoDisconnect iBCS2 emulator from the build. The ibcs2 option, the build
Konstantin Belousov [Sat, 28 Nov 2015 08:31:32 +0000 (08:31 +0000)]
Disconnect iBCS2 emulator from the build.  The ibcs2 option, the build
glue and the sources are not removed for now.

Discussed with: emaste
Sponsored by: The FreeBSD Foundation

8 years ago[ath_hal] use the correct revision information for QCA953x.
Adrian Chadd [Sat, 28 Nov 2015 06:50:09 +0000 (06:50 +0000)]
[ath_hal] use the correct revision information for QCA953x.

This probe/attaches correctly in my local branch and now displays
a useful message:

ath0: <Qualcomm Atheros QCA953x> at mem 0x18100000-0x1811ffff irq 0 on nexus0
...
ath0: AR9530 mac 1280.0 RF5110 phy 0.0

8 years agoAdd AR9530 (honeybee) config option.
Adrian Chadd [Sat, 28 Nov 2015 01:09:30 +0000 (01:09 +0000)]
Add AR9530 (honeybee) config option.

8 years agoRegen src.conf.5 for recent option changes.
Hajimu UMEMOTO [Sat, 28 Nov 2015 00:55:49 +0000 (00:55 +0000)]
Regen src.conf.5 for recent option changes.

8 years agoFix breakage by recent collation change.
Hajimu UMEMOTO [Sat, 28 Nov 2015 00:41:37 +0000 (00:41 +0000)]
Fix breakage by recent collation change.
LC_ALL has to be exported.

8 years ago* Add device string for QCA955x (scorpion);
Adrian Chadd [Sat, 28 Nov 2015 00:27:16 +0000 (00:27 +0000)]
* Add device string for QCA955x (scorpion);
* Add device ID and device string for QCA953x (honeybee).

8 years agowrap in ATH_DEBUG.
Adrian Chadd [Sat, 28 Nov 2015 00:14:37 +0000 (00:14 +0000)]
wrap in ATH_DEBUG.

Thanks sparc64 build!

8 years ago[ath] conditionally print out the rate series information if ATH_DEBUG_XMIT is set.
Adrian Chadd [Fri, 27 Nov 2015 22:33:40 +0000 (22:33 +0000)]
[ath] conditionally print out the rate series information if ATH_DEBUG_XMIT is set.

8 years agoTake also the send queue and sent queue into account when triggering
Michael Tuexen [Fri, 27 Nov 2015 22:11:46 +0000 (22:11 +0000)]
Take also the send queue and sent queue into account when triggering
the sending of outgoing stream reset requests.

MFC after: 3 days

8 years agokbdmap: include filename when reporting fopen() failure
Ed Maste [Fri, 27 Nov 2015 21:27:39 +0000 (21:27 +0000)]
kbdmap: include filename when reporting fopen() failure

Previously only one of two cases reported the file name. Use the same
error string in both cases.

Sponsored by: The FreeBSD Foundation

8 years agoIn vm_pageout_grow_cache(), do not re-try the inactive queue when
Konstantin Belousov [Fri, 27 Nov 2015 19:43:36 +0000 (19:43 +0000)]
In vm_pageout_grow_cache(), do not re-try the inactive queue when
active queue scan initiated write.

Re-trying from the inactive queue when doing active scan makes the
loop never end if number of domains is greater than 1 and inactive or
active scan cannot reach the target.

Reported and tested by: Andrew Gallatin <gallatin@netflix.com>
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoAdd helper to catch single step debug event and distinguish it from bkpt
Zbigniew Bodek [Fri, 27 Nov 2015 19:03:59 +0000 (19:03 +0000)]
Add helper to catch single step debug event and distinguish it from bkpt

Some architectures (including ARMv6/v7) do not have separate single step
events and cannot see difference between breakpoint and single step.
Add db_pc_is_singlestep() to avoid skipping instruction we stepped on
to trigger debug event.
This commit does not change the existing functionality but adds possibility
to implement custom db_pc_is_singlestep().

Reviewed by:   imp
Submitted by:  Zbigniew Bodek <zbb@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Juniper Networks Inc.
Differential Revision: https://reviews.freebsd.org/D4036

8 years agoAdd support to libkvm for reading vmcores from other architectures.
John Baldwin [Fri, 27 Nov 2015 18:58:26 +0000 (18:58 +0000)]
Add support to libkvm for reading vmcores from other architectures.
- Add a kvaddr_type to represent kernel virtual addresses instead of
  unsigned long.
- Add a struct kvm_nlist which is a stripped down version of struct nlist
  that uses kvaddr_t for n_value.
- Add a kvm_native() routine that returns true if an open kvm descriptor
  is for a native kernel and memory image.
- Add a kvm_open2() function similar to kvm_openfiles().  It drops the
  unused 'swapfile' argument and adds a new function pointer argument for
  a symbol resolving function.  Native kernels still use _fdnlist() from
  libc to resolve symbols if a resolver function is not supplied, but cross
  kernels require a resolver.
- Add a kvm_nlist2() function similar to kvm_nlist() except that it uses
  struct kvm_nlist instead of struct nlist.
- Add a kvm_read2() function similar to kvm_read() except that it uses
  kvaddr_t instead of unsigned long for the kernel virtual address.
- Add a new kvm_arch switch of routines needed by a vmcore backend.
  Each backend is responsible for implementing kvm_read2() for a given
  vmcore format.
- Use libelf to read headers from ELF kernels and cores (except for
  powerpc cores).
- Add internal helper routines for the common page offset hash table used
  by the minidump backends.
- Port all of the existing kvm backends to implement a kvm_arch switch and
  to be cross-friendly by using private constants instead of ones that
  vary by platform (e.g. PAGE_SIZE).  Static assertions are present when
  a given backend is compiled natively to ensure the private constants
  match the real ones.
- Enable all of the existing vmcore backends on all platforms.  This means
  that libkvm on any platform should be able to perform KVA translation
  and read data from a vmcore of any platform.

Tested on: amd64, i386, sparc64 (marius)
Differential Revision: https://reviews.freebsd.org/D3341

8 years agoAdd support for exynos5_ehci in loader
Zbigniew Bodek [Fri, 27 Nov 2015 18:22:04 +0000 (18:22 +0000)]
Add support for exynos5_ehci in loader

Create new driver which initializes Arndale PHY and calls ehci_init

Reviewed by:   hselasky
Submitted by:  Wojciech Macek <wma@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Juniper Networks Inc.
Differential Revision: https://reviews.freebsd.org/D4192

8 years agoIncrease malloc area in loader/usb
Zbigniew Bodek [Fri, 27 Nov 2015 18:20:21 +0000 (18:20 +0000)]
Increase malloc area in loader/usb

Previous value was not enough on Arndale platform.

Reviewed by:   hselasky
Submitted by:  Wojciech Macek <wma@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Juniper Networks Inc.
Differential Revision: https://reviews.freebsd.org/D4145

8 years agoRun callouts during infinite waiting inside cv_wait
Zbigniew Bodek [Fri, 27 Nov 2015 18:19:11 +0000 (18:19 +0000)]
Run callouts during infinite waiting inside cv_wait

During cv_wait we may be waiting for an event triggered by callout.
Run callbacks here to avoid code blocking.

Reviewed by:   hselasky
Submitted by:  Wojciech Macek <wma@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Juniper Networks Inc.
Differential Revision: https://reviews.freebsd.org/D4144

8 years agoImplement simple ops for umass_disk
Zbigniew Bodek [Fri, 27 Nov 2015 18:17:53 +0000 (18:17 +0000)]
Implement simple ops for umass_disk

The initial IOCTL implementation supports reading disk physical
geometry.
Two additional functions were added. They allow reading/writing raw
data to the disk (default partition).

Submitted by:  Wojciech Macek <wma@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Juniper Networks Inc.
Differential Revision: https://reviews.freebsd.org/D4143

8 years agoDo not zero memory in umass_detach
Zbigniew Bodek [Fri, 27 Nov 2015 18:16:10 +0000 (18:16 +0000)]
Do not zero memory in umass_detach

The detach function is called very often, for example from
get_capacity function. We don't want to loose any pointers
here, so disable detaching for umass driver.

Submitted by:  Wojciech Macek <wma@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Juniper Networks Inc.
Differential Revision: https://reviews.freebsd.org/D4141

8 years agoImplement missing bus_space_subregion in kshim
Zbigniew Bodek [Fri, 27 Nov 2015 18:14:45 +0000 (18:14 +0000)]
Implement missing bus_space_subregion in kshim

Add missing function, used by exynos5_ehci driver.

Reviewed by:   hselasky
Submitted by:  Wojciech Macek <wma@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Juniper Networks Inc.
Differential Revision: https://reviews.freebsd.org/D4141

8 years agoUse properly aligned buffer in usb_alloc
Zbigniew Bodek [Fri, 27 Nov 2015 18:13:28 +0000 (18:13 +0000)]
Use properly aligned buffer in usb_alloc

The PA adress must be gathered from an aligned VA,
not the RAW pointer to the memory space.

Reviewed by:   hselasky
Submitted by:  Wojciech Macek <wma@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Juniper Networks Inc.
Differential Revision: https://reviews.freebsd.org/D4140

8 years agosfxge: cleanup: report error on failure path in efx_vpd_hunk_verify
Andrew Rybchenko [Fri, 27 Nov 2015 16:23:27 +0000 (16:23 +0000)]
sfxge: cleanup: report error on failure path in efx_vpd_hunk_verify

If the VPD is corrupt and contains an 'RV' keyword before the
END tag, then this function could return without setting the
return code to report the error.

Found by prefast.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: cleanup: fix prefast annotations on mac stats updates
Andrew Rybchenko [Fri, 27 Nov 2015 16:21:14 +0000 (16:21 +0000)]
sfxge: cleanup: fix prefast annotations on mac stats updates

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: fix prefast warning in falconsiena_tx_qcreate
Andrew Rybchenko [Fri, 27 Nov 2015 16:18:59 +0000 (16:18 +0000)]
sfxge: fix prefast warning in falconsiena_tx_qcreate

Keep prefast happy by returning the initial queue index
from falconsiena_tx_qcreate(). No change in behaviour, as
etxo_qcreate already zeros *addedp before the call.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: cleanup: fix prefast annotations for stats buffers
Andrew Rybchenko [Fri, 27 Nov 2015 16:16:45 +0000 (16:16 +0000)]
sfxge: cleanup: fix prefast annotations for stats buffers

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: unlink PIO buffers from VIs in WC mapping in hunt_nic_fini()
Andrew Rybchenko [Fri, 27 Nov 2015 16:07:20 +0000 (16:07 +0000)]
sfxge: unlink PIO buffers from VIs in WC mapping in hunt_nic_fini()

PIO is not yet supported in the FreeBSD driver.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: infer external port numbering for Pavia
Andrew Rybchenko [Fri, 27 Nov 2015 16:03:51 +0000 (16:03 +0000)]
sfxge: infer external port numbering for Pavia

Adjust external port mapping table to distinguish Pavia from Monza.
Now the presence of any 40G mode implies at least 2 outputs per
external port.  So Pavia 4x10G ports are now mapped to 1,2,3,4;
Monza 4x10G ports map to 1,1,2,2 as before.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: cleanup: fix prefast annotation
Andrew Rybchenko [Fri, 27 Nov 2015 15:58:52 +0000 (15:58 +0000)]
sfxge: cleanup: fix prefast annotation

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: do not use unnamed union in siena_mc_combo_rom_hdr_t
Andrew Rybchenko [Fri, 27 Nov 2015 15:54:36 +0000 (15:54 +0000)]
sfxge: do not use unnamed union in siena_mc_combo_rom_hdr_t

GCC 4.2.1 used on FreeBSD 8 and 9 branches does not like unnamed
union member in the structure. It is not strictly required in head,
but nice to have to minimize difference with out-of-tree driver.

Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agosfxge: cleanup: error probe correction
Andrew Rybchenko [Fri, 27 Nov 2015 15:50:17 +0000 (15:50 +0000)]
sfxge: cleanup: error probe correction

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days

8 years agoUse netbsd usage() implementation in newfs_msdos
Ed Maste [Fri, 27 Nov 2015 14:40:21 +0000 (14:40 +0000)]
Use netbsd usage() implementation in newfs_msdos

In r289629 newfs_msdos option descriptions are available in
mkfs_msdos.h.

Obtained from: NetBSD

8 years agoFix panic when trying to sort unsupported command in OOA queue.
Alexander Motin [Fri, 27 Nov 2015 14:29:04 +0000 (14:29 +0000)]
Fix panic when trying to sort unsupported command in OOA queue.

Handle unsupported commands as not conflicting/blocking.

8 years agomkfs_msdos: sync with NetBSD
Ed Maste [Fri, 27 Nov 2015 14:20:32 +0000 (14:20 +0000)]
mkfs_msdos: sync with NetBSD

Add a sanity test and clean up whitespace.

Obtained from: NetBSD

8 years agoRemove VI_AGE vnode iflag, it is unused.
Konstantin Belousov [Fri, 27 Nov 2015 01:45:40 +0000 (01:45 +0000)]
Remove VI_AGE vnode iflag, it is unused.

Noted by: bde
Sponsored by: The FreeBSD Foundation

8 years agoMove the comment about resident pages preventing vnode from leaving
Konstantin Belousov [Fri, 27 Nov 2015 01:16:35 +0000 (01:16 +0000)]
Move the comment about resident pages preventing vnode from leaving
active list, into the header comment for vdrop(), which is the
function that decides whether to leave the vnode on the list.  Note
that dirty page write-out in vinactive() is asynchronous.

Discussed with: alc
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agovidfont: with vt(4) omit size from vidcontrol -f
Ed Maste [Fri, 27 Nov 2015 00:04:39 +0000 (00:04 +0000)]
vidfont: with vt(4) omit size from vidcontrol -f

When using syscons, vidfont extracts the font size from the filename
passes it to vidcontrol -f. In vt(4) mode the size argument is not
required, and some of the fonts in /usr/share/vt/fonts do not have the
size in the filename, which caused vidfont to fail. Thus, just omit the
size argument in vt(4) mode.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

8 years agoWhen the sending of an SCTP outgoing stream reset request fails,
Michael Tuexen [Thu, 26 Nov 2015 23:12:41 +0000 (23:12 +0000)]
When the sending of an SCTP outgoing stream reset request fails,
don't report it to the user since all stream have been marked
as pending.

MFC after: 1 week

8 years agor291198 inadvertantly reverted a local patch for the default location
Dag-Erling Smørgrav [Thu, 26 Nov 2015 23:05:40 +0000 (23:05 +0000)]
r291198 inadvertantly reverted a local patch for the default location
of ssh-askpass and xauth, breaking X11 forwarding.

8 years agoFix whitespace on addition of IPSEC option
Ed Maste [Thu, 26 Nov 2015 21:35:50 +0000 (21:35 +0000)]
Fix whitespace on addition of IPSEC option

8 years agoCorrect arm64 gic_v3 sizeof argument
Ed Maste [Thu, 26 Nov 2015 21:05:55 +0000 (21:05 +0000)]
Correct arm64 gic_v3 sizeof argument

No functional change as 'struct resource *' and 'struct resource **'
have the same size, but the former is the proper type.

PR: 204768
Submitted by: David Binderman

8 years agoRemove trailing whitespace.
John Baldwin [Thu, 26 Nov 2015 19:42:10 +0000 (19:42 +0000)]
Remove trailing whitespace.

8 years agoRemove kvm_sparc.c. This is for 32-bit sparc support and was imported
John Baldwin [Thu, 26 Nov 2015 19:39:15 +0000 (19:39 +0000)]
Remove kvm_sparc.c.  This is for 32-bit sparc support and was imported
from 4.4BSD.  It has never been used by FreeBSD.

8 years agoCorrect an error in vm_reserv_reclaim_contig(). In the highly unusual
Alan Cox [Thu, 26 Nov 2015 19:12:18 +0000 (19:12 +0000)]
Correct an error in vm_reserv_reclaim_contig().  In the highly unusual
case that the reservation contained "low", the starting position in the
popmap for the free page search was incorrectly calculated.  The most
likely (and visible) symptom of this error was the assertion failure,
"vm_reserv_reclaim_contig: pa is too low".

8 years agoRemove residual functions declaration left after r291365.
Alexander Motin [Thu, 26 Nov 2015 18:56:21 +0000 (18:56 +0000)]
Remove residual functions declaration left after r291365.

8 years ago[wpa] use IFM_IEEE80211_ADHOC for now on FreeBSD for IBSS operation.
Adrian Chadd [Thu, 26 Nov 2015 17:28:40 +0000 (17:28 +0000)]
[wpa] use IFM_IEEE80211_ADHOC for now on FreeBSD for IBSS operation.

PR: bin/203086
Submitted by: avos

8 years agoRename sysctl node hw.imx6 to hw.imx. Move its definition to imx_machdep.c
Ian Lepore [Thu, 26 Nov 2015 17:26:52 +0000 (17:26 +0000)]
Rename sysctl node hw.imx6 to hw.imx.  Move its definition to imx_machdep.c
so that code shared between imx5 and imx6 can work with OIDs under that node.

Add last_reset_status (integer) and last_reset_reason (string) OIDs that
provide info about the last chip reset (power-on, software reset, watchdog
timeout).

8 years ago[wpa] bring up interface in ap_mode=2
Adrian Chadd [Thu, 26 Nov 2015 17:26:28 +0000 (17:26 +0000)]
[wpa] bring up interface in ap_mode=2

This is required for WPA-NONE operation.

PR: bin/203086
Submitted by: avos@

8 years agoOne more round of port scanner rewrite.
Alexander Motin [Thu, 26 Nov 2015 13:04:58 +0000 (13:04 +0000)]
One more round of port scanner rewrite.

 - Make scan aborted by event restart immediately and infinitely.
 - Improve handling of some loop events from firmware.
 - Remove loop down timer, adding its functionality to scanner thread.
 - Some more unification and simplification.

8 years agoWhen receiving an SCTP/UDP packet and the interface performed
Michael Tuexen [Thu, 26 Nov 2015 09:25:20 +0000 (09:25 +0000)]
When receiving an SCTP/UDP packet and the interface performed
the UDP checksum computation and signals that it was OK,
clear this bit when passing the packet to SCTP. Since the
bits indicating a valid UDP checksum and a valid SCTP
checksum are the same, the SCTP stack would assume
that also an SCTP checksum check has been performed.

MFC after: 1 week

8 years agoClean up trailing whitespace
Enji Cooper [Thu, 26 Nov 2015 08:58:13 +0000 (08:58 +0000)]
Clean up trailing whitespace

MFC after: 1 week

8 years agor291359 was incorrect. Skip over tokens that start with `#' as fgetln can
Enji Cooper [Thu, 26 Nov 2015 07:58:22 +0000 (07:58 +0000)]
r291359 was incorrect. Skip over tokens that start with `#' as fgetln can
return more than one '\n' delimited line in a buffer

Handle empty lines too, just in case

MFC after: 3 days
X-MFC with: r291359

8 years agoSkip over lines that start with # (comments)
Enji Cooper [Thu, 26 Nov 2015 07:03:59 +0000 (07:03 +0000)]
Skip over lines that start with # (comments)

MFC after: 3 days

8 years agoRemove cnftp.bjpu.edu.cn (it no longer resolves)
Enji Cooper [Thu, 26 Nov 2015 07:03:26 +0000 (07:03 +0000)]
Remove cnftp.bjpu.edu.cn (it no longer resolves)
Add localhost to resolv/mach for parity with nss/mach

MFC after: 3 days

8 years ago[wpa] handle IBSS mediatype.
Adrian Chadd [Thu, 26 Nov 2015 02:00:37 +0000 (02:00 +0000)]
[wpa] handle IBSS mediatype.

same as the previous commit to ifconfig - handle a mediatype of IBSS
without failing/complaining.

Internally inside wpa_s things treat IBSS/ADHOC as equivalent.

8 years ago[ifconfig] handle IBSS mediatype correctly.
Adrian Chadd [Thu, 26 Nov 2015 01:58:50 +0000 (01:58 +0000)]
[ifconfig] handle IBSS mediatype correctly.

Right now net80211 is configured as type IBSS but then treats it
as mediatype ADHOC.  This doesn't change that; it just correctly handles
being given a mediatype of IBSS.

8 years ago[net80211] decode WPA cipher config '0' as "clear cipher config".
Adrian Chadd [Thu, 26 Nov 2015 01:54:58 +0000 (01:54 +0000)]
[net80211] decode WPA cipher config '0' as "clear cipher config".

wpa_supplicant actually calls the wpa ioctl with cipher 0 as part
of the teardown process and this returns an ioctl error.

It's required as part of the (hopefully!) upcoming encrypted
IBSS support which does indeed do the above as part of interface
setup and then exits ungracefully when it gets an ioctl error.

(I'll fix wpa_supplicant in a later commit as part of other work.)

8 years agoAlways build libevent, which fixes the build for usr.sbin/ypldap after r291230.
Bryan Drewery [Thu, 26 Nov 2015 01:54:09 +0000 (01:54 +0000)]
Always build libevent, which fixes the build for usr.sbin/ypldap after r291230.

The dependency for ypldap is only with WITH_NIS, but libevent is small
enough to not warrant the extra logic and maintenance cost here so just
always build it.

Sponsored by: EMC / Isilon Storage Division

8 years agoStandardize on OBJTOP in and outside of META MODE.
Bryan Drewery [Thu, 26 Nov 2015 01:47:56 +0000 (01:47 +0000)]
Standardize on OBJTOP in and outside of META MODE.

Sponsored by: EMC / Isilon Storage Division

8 years agoUse LIBEXECDIR for /usr/libexec.
Bryan Drewery [Thu, 26 Nov 2015 01:14:40 +0000 (01:14 +0000)]
Use LIBEXECDIR for /usr/libexec.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoMETA MODE: These need object directories to handle staging.
Bryan Drewery [Thu, 26 Nov 2015 01:14:27 +0000 (01:14 +0000)]
META MODE: These need object directories to handle staging.

Sponsored by: EMC / Isilon Storage Division

8 years agoReplace the retval.sh shell script with a native DTrace script.
George V. Neville-Neil [Thu, 26 Nov 2015 00:53:39 +0000 (00:53 +0000)]
Replace the retval.sh shell script with a native DTrace script.

Suggested by: markj

8 years agoParseTrackInput: do not access beyond end of buffer.
Simon J. Gerraty [Thu, 26 Nov 2015 00:26:23 +0000 (00:26 +0000)]
ParseTrackInput: do not access beyond end of buffer.

Reviewed by: dim

8 years agoSummary: A simple script to print the return value of any function,
George V. Neville-Neil [Wed, 25 Nov 2015 22:59:41 +0000 (22:59 +0000)]
Summary: A simple script to print the return value of any function,
with or without wild cards.

8 years agoFollow-up r291338 to handle .d, .y and .l files better as well.
Bryan Drewery [Wed, 25 Nov 2015 22:40:14 +0000 (22:40 +0000)]
Follow-up r291338 to handle .d, .y and .l files better as well.

X-MFC-With: r291338
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoFollow-up r291330: h_testbits.h is only needed by xdr_test.
Bryan Drewery [Wed, 25 Nov 2015 22:33:25 +0000 (22:33 +0000)]
Follow-up r291330: h_testbits.h is only needed by xdr_test.

X-MFC-With: r291330
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoFix the "common object" handling to not depend on ".o" if SRCS only contains
Bryan Drewery [Wed, 25 Nov 2015 22:32:16 +0000 (22:32 +0000)]
Fix the "common object" handling to not depend on ".o" if SRCS only contains
headers.

This resulted in 'don't know how to make .o.' errors after the changes in
r289286.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoLink fclose(3) to fdclose(3)
Enji Cooper [Wed, 25 Nov 2015 22:07:18 +0000 (22:07 +0000)]
Link fclose(3) to fdclose(3)

X-MFC with: r285140
MFC after: 3 weeks (need to evaluate whether or not r285140 can be MFCed)
Sponsored by: EMC / Isilon Storage Division

8 years agoFix building sys/modules/if_enc by adding missing headers
Enji Cooper [Wed, 25 Nov 2015 21:16:10 +0000 (21:16 +0000)]
Fix building sys/modules/if_enc by adding missing headers

X-MFC with: r291292, r291299 (if that ever happens)
Pointyhat to: ae

8 years agoRename Makefile.inc1 to dtrace.test.mk to avoid clash with top-level Makefile.inc1.
Bryan Drewery [Wed, 25 Nov 2015 20:43:45 +0000 (20:43 +0000)]
Rename Makefile.inc1 to dtrace.test.mk to avoid clash with top-level Makefile.inc1.

Discussed with: ngie, markj
Sponsored by: EMC / Isilon Storage Division

8 years agoAvoid requiring 'make depend' here.
Bryan Drewery [Wed, 25 Nov 2015 20:38:20 +0000 (20:38 +0000)]
Avoid requiring 'make depend' here.

Really this should not be a DPSRCS.  The acct_test.c should not #include
convert.c, but just link it in as a normal SRCS.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoReplace DPSRCS that work fine in SRCS.
Bryan Drewery [Wed, 25 Nov 2015 20:38:17 +0000 (20:38 +0000)]
Replace DPSRCS that work fine in SRCS.

This is so that 'make depend' is not a required build step in these
files.

DPSRCS is overall unneeded.  DPSRCS already contains SRCS, so anything
which can safely be in SRCS should be.  DPSRCS is mostly just a way to
generate files that should not be linked into the final PROG/LIB.  For
headers and grammars it is safe for them to be in SRCS since they will
be excluded during linking and installation.

The only remaining uses of DPSRCS are for generating .c or .o files that
must be built before 'make depend' can run 'mkdep' on the SRCS c files
list.  A semi-proper example is in tests/sys/kern/acct/Makefile where a
checked-in .c file has an #include on a generated .c file.  The
generated .c file should not be linked into the final PROG though since
it is #include'd.  The more proper way here is just to build/link it in
though without DPSRCS.  Another example is in sys/modules/linux/Makefile
where a shell script runs to parse a DPSRCS .o file that should not be
linked into the module.  Beyond those, the need for DPSRCS is largely
unneeded, redundant, and forces 'make depend' to be ran.  Generally,
these Makefiles should avoid the need for DPSRCS and define proper
dependencies for their files as well.

An example of an improper usage and why this matters is in usr.bin/netstat.
nl_defs.h was only in DPSRCS and so was not generated during 'make all',
but only during 'make depend'.  The files including it lacked proper
depenencies on it, which forced running 'make depend' to workaround that
bug.  The 'make depend' target should mostly be used for incremental build
help, not to produce a working build.  This specific example was broken in
the meta build until r287905 since it does not run 'make depend'.

The gnu/lib/libreadline/readline case is fine since bsd.lib.mk has 'OBJS:
SRCS:M*.h' when there is no .depend file.

Sponsored by: EMC / Isilon Storage Division
MFC after: 1 week

8 years agoRemove redundant DPSRCS which were already in SRCS.
Bryan Drewery [Wed, 25 Nov 2015 20:38:07 +0000 (20:38 +0000)]
Remove redundant DPSRCS which were already in SRCS.

DPSRCS already contains all of SRCS.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoHave syslogd honor 'mesg' status when logging to users.
Kurt Lidl [Wed, 25 Nov 2015 20:01:11 +0000 (20:01 +0000)]
Have syslogd honor 'mesg' status when logging to users.

PR: bin/196742
Submitted by: jef at mail acme com
Approved by: rpaulo (mentor)
Differential Revision: https://reviews.freebsd.org/D4270

8 years agoDefine a LIB<NAME>DIR for every library that LIBADD provides.
Bryan Drewery [Wed, 25 Nov 2015 19:49:55 +0000 (19:49 +0000)]
Define a LIB<NAME>DIR for every library that LIBADD provides.

This is going to be used to allow DIRDEPS to be bootstrapped off of
LIBADD/DPADD.  It currently works for internal libraries which have a
DIR defined for them but also use the .a library from a src-mapped obj
directory.  It can also be useful for using -L without a --sysroot per
LIBADD to use the OBJDIR version of the libraries.

I didn't review every LIBADD, so it is possible this is missing some.

Sponsored by: EMC / Isilon Storage Division

8 years agoFix spelling error.
Bryan Drewery [Wed, 25 Nov 2015 19:48:09 +0000 (19:48 +0000)]
Fix spelling error.

8 years agoMETA MODE: Avoid dirdep dependency on lib/libmd.
Bryan Drewery [Wed, 25 Nov 2015 19:45:04 +0000 (19:45 +0000)]
META MODE: Avoid dirdep dependency on lib/libmd.

This avoids using the staged headers for sys/crypto/sha2/*.h, such as sha256.h,
which added an unneeded pre-build dependency on libmd to libcrypt.  This
header is an INCS in lib/libmd, but found via .PATH in sys/crypto/sha2.
Since the libcrypt build was already using the in-src libmd headers
directly, just teach it how to find the sha256.h header as well.

Sponsored by: EMC / Isilon Storage Division

8 years agoMETA MODE: Fix MACHINE=host builds.
Bryan Drewery [Wed, 25 Nov 2015 19:45:01 +0000 (19:45 +0000)]
META MODE: Fix MACHINE=host builds.

We need to not use -nostdinc since it breaks building of clang itself.  Use
-isystem rather than -I/usr/include and -nostdinc which gets us using
the stage include directory before searching the real host headers.
This allows removing more of the -I hacks to get host headers since the
headers are no longer excluded.  The -B seemed unneeded.

This fixes building of secure/lib/libcrypto which was looking at the
/usr/include/openssl/asn1.h header rather than the staged one.

This fixes building of clang which wants to find its own internal
headers in the STAGEDIR/usr/lib/clang/* path.

Sponsored by: EMC / Isilon Storage Division

8 years agoStop looking up the same id(1) results in sub-makes.
Bryan Drewery [Wed, 25 Nov 2015 19:44:58 +0000 (19:44 +0000)]
Stop looking up the same id(1) results in sub-makes.

Sponsored by: EMC / Isilon Storage Division

8 years agoMETA MODE: Remove unneeded libmd.host dependency for xinstall.host.
Bryan Drewery [Wed, 25 Nov 2015 19:44:55 +0000 (19:44 +0000)]
META MODE: Remove unneeded libmd.host dependency for xinstall.host.

This is chasing r291026.

Sponsored by: EMC / Isilon Storage Division

8 years agoMETA MODE: Fix 'make bootstrap-tools'.
Bryan Drewery [Wed, 25 Nov 2015 19:44:51 +0000 (19:44 +0000)]
META MODE: Fix 'make bootstrap-tools'.

The main problem was bitrot after elftoolchain being swapped in for the
GNU toolchain.

This also reworks how the list of 'host allowed' libraries is determined
to only allow INTERNALLIBs, which is needed for libelftc to come in.

For usr.bin/readelf use the same hack, as libelf and libdward, to bring in
the needed sys/ headers for host builds.  This has not yet been a problem due
to readelf not being built as a host tool in buildworld.  This is possible
in the meta build though when building the toolchain.

Sponsored by: EMC / Isilon Storage Division

8 years agoMETA MODE: Don't create .meta files when symlinking sources into the obj directory.
Bryan Drewery [Wed, 25 Nov 2015 19:44:43 +0000 (19:44 +0000)]
META MODE: Don't create .meta files when symlinking sources into the obj directory.

Tracking these leads to situations where meta mode will consider the
file to be out of date if /bin/sh or /bin/ln are newer than the source
file.  There's no reason for meta mode to do this as make is already
handling the rebuild dependency fine.

Sponsored by: EMC / Isilon Storage Division

8 years agoMETA MODE: Add more hosttools needed pre-universe.
Bryan Drewery [Wed, 25 Nov 2015 19:44:34 +0000 (19:44 +0000)]
META MODE: Add more hosttools needed pre-universe.

Sponsored by: EMC / Isilon Storage Division

8 years agoMETA MODE: Show PATH on errors.
Bryan Drewery [Wed, 25 Nov 2015 19:44:31 +0000 (19:44 +0000)]
META MODE: Show PATH on errors.

Sponsored by: EMC / Isilon Storage Division

8 years agoMETA MODE: Need to include the LEGACY_TOOLS directories into PATH.
Bryan Drewery [Wed, 25 Nov 2015 19:44:28 +0000 (19:44 +0000)]
META MODE: Need to include the LEGACY_TOOLS directories into PATH.

This is just as Makefile.inc1 does it for these phases.  Otherwise some
of the build tools are not found and used properly, such as 'make-roken'
in the kerberos5 build on older releases.

Sponsored by: EMC / Isilon Storage Division

8 years agoMETA MODE: Don't add staged DPADDs to DIRDEPS when bootstrapping gendirdeps.
Bryan Drewery [Wed, 25 Nov 2015 19:13:45 +0000 (19:13 +0000)]
META MODE: Don't add staged DPADDs to DIRDEPS when bootstrapping gendirdeps.

This was finding libraries that were installed into DESTDIR/usr/lib,
where DESTDIR is the stage directory, and then adding in usr/lib to
DIRDEPS.  Just exclude the STAGE_ROOT if defined.

Discussed with: sjg
Sponsored by: EMC / Isilon Storage Division

8 years agoMETA MODE: Define variables this file uses that were defined elsewhere.
Bryan Drewery [Wed, 25 Nov 2015 19:13:42 +0000 (19:13 +0000)]
META MODE: Define variables this file uses that were defined elsewhere.

Discussed with: sjg
Sponsored by: EMC / Isilon Storage Division

8 years agoMETA MODE: Don't truncate DIRDEPS for bootstrapping during gendirdeps.
Bryan Drewery [Wed, 25 Nov 2015 19:13:39 +0000 (19:13 +0000)]
META MODE: Don't truncate DIRDEPS for bootstrapping during gendirdeps.

Reviewed by: sjg
Sponsored by: EMC / Isilon Storage Division

8 years agoMETA MODE: Rework circular dependency guard for librtld_db/libproc.
Bryan Drewery [Wed, 25 Nov 2015 19:13:35 +0000 (19:13 +0000)]
META MODE: Rework circular dependency guard for librtld_db/libproc.

librtld_db only needs libutil.h to build, not the libproc library.  So
it can safely use its header and allow libproc to depend on librtld_rb
to be built first to link.  This is required after fixing ld --sysroot
in r291226.

Sponsored by: EMC / Isilon Storage Division