]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoMove to SCHED_ULE by default. Since r226057 SCHED_ULE and sparc64 are
marius [Fri, 25 Nov 2011 17:40:01 +0000 (17:40 +0000)]
Move to SCHED_ULE by default. Since r226057 SCHED_ULE and sparc64 are
compatible with each other and since r227539 the last issue seen when
using SCHED_ULE is fixed. At least on UP and 2-way machines SCHED_4BSD
still performs better than SCHED_ULE, however, the optimizations done
in r225889 pretty much compensate that so there's at least no net
regression.
Thanks go to Peter Jeremy for extensive testing.

12 years agoFix build.
delphij [Fri, 25 Nov 2011 07:11:02 +0000 (07:11 +0000)]
Fix build.

12 years agoRemove DEBUG_FLAGS.
fjoe [Fri, 25 Nov 2011 07:10:59 +0000 (07:10 +0000)]
Remove DEBUG_FLAGS.

12 years agoAdd firmware update support for SCSI devices.
emaste [Fri, 25 Nov 2011 04:03:37 +0000 (04:03 +0000)]
Add firmware update support for SCSI devices.

Firmware can be reprogrammed on devices from Hitachi, HP, IBM, Plextor,
Quantum, and Seagate.  At least one device from each manufacturer has
been tested with some version of this code, and it has been used to
update thousands of drives so far.

The man page suggests having a backup of the drive's data, and the
operation must be confirmed, either interactively or on the command
line.  (This is the same as the confirmation on the format command.)

This work is largely derived from fwprog.c by Andre Albsmeier.

Submitted by: Nima Misaghian
Sponsored by: Sandvine Incorporated
MFC after: 3 months

12 years agoIncrease the CDMA sync timeout for Schizo bridges to 15 seconds as used by
marius [Thu, 24 Nov 2011 23:48:22 +0000 (23:48 +0000)]
Increase the CDMA sync timeout for Schizo bridges to 15 seconds as used by
OpenSolaris. One second turned out to be not enough for certain loads while
10 seconds were sufficient.
Reported by: Peter Jeremy

MFC after: 3 days

12 years agoRemove superfluous check: SIOCAIFADDR must have ifra_addr supplied.
glebius [Thu, 24 Nov 2011 22:46:11 +0000 (22:46 +0000)]
Remove superfluous check: SIOCAIFADDR must have ifra_addr supplied.

12 years agoFix stupid typo in r227830.
glebius [Thu, 24 Nov 2011 22:43:48 +0000 (22:43 +0000)]
Fix stupid typo in r227830.

PR: 162806
Pointy hat to: glebius

12 years agoAdjust a few old checks to use __FreeBSD_version macro to
rmh [Thu, 24 Nov 2011 21:23:58 +0000 (21:23 +0000)]
Adjust a few old checks to use __FreeBSD_version macro to
determine which version of FreeBSD kernel we're compiling.

Approved by: kib (mentor)

12 years agousr.bin/procstat
trociny [Thu, 24 Nov 2011 20:54:06 +0000 (20:54 +0000)]
usr.bin/procstat

Add -l flag to display resource limits.

PR: bin/161257
Reviewed by: kib
MFC after: 2 weeks

12 years agoAdd sysctl to get process resource limits.
trociny [Thu, 24 Nov 2011 20:43:37 +0000 (20:43 +0000)]
Add sysctl to get process resource limits.

Reviewed by: kib
MFC after: 2 weeks

12 years agoAdd const qualifier to rlimit_ident.
trociny [Thu, 24 Nov 2011 20:37:09 +0000 (20:37 +0000)]
Add const qualifier to rlimit_ident.

Reviewed by: kib
MFC after: 2 weeks

12 years agolibodialog: Remove no longer used library.
fjoe [Thu, 24 Nov 2011 20:34:50 +0000 (20:34 +0000)]
libodialog: Remove no longer used library.

12 years agoFix a race between getvnode() dereferencing half-constructed file
kib [Thu, 24 Nov 2011 20:34:06 +0000 (20:34 +0000)]
Fix a race between getvnode() dereferencing half-constructed file
and dupfdopen().

Reported and tested by: pho
MFC after: 3 days

12 years agolibodialog: disconnect from the build and obsolete.
fjoe [Thu, 24 Nov 2011 20:31:06 +0000 (20:31 +0000)]
libodialog: disconnect from the build and obsolete.

12 years agocalloc +1 DIALOG_LISTITEM to prevent possible wild pointer access
fjoe [Thu, 24 Nov 2011 18:45:23 +0000 (18:45 +0000)]
calloc +1 DIALOG_LISTITEM to prevent possible wild pointer access
in dlg_default_listitem().

12 years agoPort to new libdialog.
fjoe [Thu, 24 Nov 2011 18:37:16 +0000 (18:37 +0000)]
Port to new libdialog.

12 years agoDisk selection dialog is now a normal menu, not a checkboxed menu:
fjoe [Thu, 24 Nov 2011 15:47:01 +0000 (15:47 +0000)]
Disk selection dialog is now a normal menu, not a checkboxed menu:
checkboxed menu is confusing and also can not be implemented
in new libdialog.

12 years agoI've had verification that the second-last 64k is actually used by the tplink
adrian [Thu, 24 Nov 2011 15:12:57 +0000 (15:12 +0000)]
I've had verification that the second-last 64k is actually used by the tplink
firmware to store configuration data.

It's safe to overwrite it.

12 years agoAdd missing ;;
fjoe [Thu, 24 Nov 2011 14:22:05 +0000 (14:22 +0000)]
Add missing ;;

12 years agoUse ${VAR} instead of $(VAR) consistently.
fjoe [Thu, 24 Nov 2011 14:17:04 +0000 (14:17 +0000)]
Use ${VAR} instead of $(VAR) consistently.

12 years agoUtility script to build specific parts of the source tree on all arches
fjoe [Thu, 24 Nov 2011 14:16:01 +0000 (14:16 +0000)]
Utility script to build specific parts of the source tree on all arches

12 years agoPort to new libdialog.
fjoe [Thu, 24 Nov 2011 13:24:06 +0000 (13:24 +0000)]
Port to new libdialog.

12 years agoRevert r227841 and part of r227798. We still build libpam in two passes,
des [Thu, 24 Nov 2011 13:18:58 +0000 (13:18 +0000)]
Revert r227841 and part of r227798.  We still build libpam in two passes,
but we use STATIC_CFLAGS instead of our own private .c.o rule.

MFC after: 3 weeks

12 years agoAdd CTF magic to the new .c.o rule.
des [Thu, 24 Nov 2011 13:13:50 +0000 (13:13 +0000)]
Add CTF magic to the new .c.o rule.

MFC after: 3 weeks

12 years agoMove up the address to the top of the sctp_udencaps structure
tuexen [Thu, 24 Nov 2011 10:58:48 +0000 (10:58 +0000)]
Move up the address to the top of the sctp_udencaps structure
like in all other structures. This avoids alignment problems.

MFC after: 3 months.

12 years agoMove up the address to the top of the sctp_paddrthlds structure
tuexen [Thu, 24 Nov 2011 10:54:30 +0000 (10:54 +0000)]
Move up the address to the top of the sctp_paddrthlds structure
like in all other structures. This avoids alignment problems.

MFC after: 3 days.

12 years agoRemove unused code.
fjoe [Thu, 24 Nov 2011 10:08:22 +0000 (10:08 +0000)]
Remove unused code.

12 years agoRemove unused code.
fjoe [Thu, 24 Nov 2011 08:56:24 +0000 (08:56 +0000)]
Remove unused code.

12 years agoNow that I've brought up FreeBSD via flash, I've discovered that
adrian [Thu, 24 Nov 2011 07:37:19 +0000 (07:37 +0000)]
Now that I've brought up FreeBSD via flash, I've discovered that
the second-last 64k seems to be the default firmware board configuration
area.

Since I have no idea whether uboot uses it or not - and it's prefixed
with an atheros eeprom signature (0xaa55), I figure the safest thing
to do is mark it as read-only.

I've modified my local tplink firmware building program to generate
a board configuration section - which is separate to this partition.
It's located in the 64k _before_ this particular 64k.

The firmware build program from OpenWRT never initialises those
values and the firmware images from tplink also leave it 0x0, so I
don't currently know what the exact, correct details should be.

12 years agoFlip on AR71XX_ENV_UBOOT so the environment variables are properly
adrian [Thu, 24 Nov 2011 07:33:41 +0000 (07:33 +0000)]
Flip on AR71XX_ENV_UBOOT so the environment variables are properly
processed. (Which is to say they're currently ignored.)

12 years agoIntroduce a new (global, sorry!) option which controls whether
adrian [Thu, 24 Nov 2011 07:32:52 +0000 (07:32 +0000)]
Introduce a new (global, sorry!) option which controls whether
the ar71xx platform code should assume a uboot or redboot environment.

The current code gets very confused (and just crashes) on a uboot
environment, where each attribute=value pair is in a single entry.
Redboot on the other hand stores it as "attribute", "value", "attribute",
"value", ...

This allows the kernel to boot on a TP-LINK TL-WR1043ND from flash,
where the uboot environment gets setup. This didn't show up during a netboot
as "tftpboot" and "go" don't setup the uboot environment variables.

12 years agoDon't compile in the AR9130 embedded WMAC code into the HAL by default.
adrian [Thu, 24 Nov 2011 06:27:47 +0000 (06:27 +0000)]
Don't compile in the AR9130 embedded WMAC code into the HAL by default.

This won't work unless AH_SUPPORT_AR9130 which can't be enabled - it
breaks the other 11n chipsets for now.

Sponsored by: Hobnob, Inc.

12 years agoFlesh out a geom_map setup, so the kernel can be squeezed _onto_ the device.
adrian [Thu, 24 Nov 2011 04:39:01 +0000 (04:39 +0000)]
Flesh out a geom_map setup, so the kernel can be squeezed _onto_ the device.

The default flash layout gives only 1 megabyte for the kernel, gzipped.
The uboot firmware running on this device only supports gzip, not lzma, so
we actually _do_ have to try and slim the kernel down a bit.

But, since I can't actually do that at the present, I'm opting to:

* extend the kernel from 1mb to 2mb;
* have rootfs fill the rest of that, save 64k;
* eventually I'll hide a 64k config partition at the end, between the
  end of rootfs and the ART (radio configuration data.)

The uboot firmware doesn't care about the partition layout. It just
expects the kernel application image to sit at 0xbf020000 (right after
the 128k uboot image.) The uboot header isn't actually read either -
it's "faked" from a "tplink" flash image header. So as long as the
map configuration here matches what is being written out via the
tplink firmware generator, everything is a-ok.

12 years agoCompile in the right bits so the AR9130 WMAC support functions correctly.
adrian [Thu, 24 Nov 2011 04:34:04 +0000 (04:34 +0000)]
Compile in the right bits so the AR9130 WMAC support functions correctly.

A previous commit disabled compiling the AR9130 support in the default
HAL build in the kernel. Since the AR9130 support won't actually function
without AH_SUPPORT_AR9130 (and that abomination needs to be undone at some
point, in order to allow USB 11n NICs to also work), we now have to
explicitly compile it in.

But since the 11n RF backends don't (currently) join the RF linker set,
one has to compile in _an_ RF backend for the HAL to compile.

12 years agoAdd a comment documenting where the WMAC hangs off of.
adrian [Thu, 24 Nov 2011 04:23:42 +0000 (04:23 +0000)]
Add a comment documenting where the WMAC hangs off of.

At some point it would be nice to correctly update the bus glue to make
this "correct", including having the DDR flush occur in the right spot
(ie, any AHB interrupt.)

12 years agoFlip on these debugging options by default. This is -HEAD after all.
adrian [Thu, 24 Nov 2011 04:21:19 +0000 (04:21 +0000)]
Flip on these debugging options by default. This is -HEAD after all.

12 years agoSlim the default build down a little:
adrian [Thu, 24 Nov 2011 04:19:02 +0000 (04:19 +0000)]
Slim the default build down a little:

* Disable the NFS client, it's not needed for booting off of flash.
* Don't compile in softdep, snapshots, ufs acls and directory hashing.

12 years agoTo save more power, switch to 10/100Mbps link when controller is
yongari [Wed, 23 Nov 2011 23:29:18 +0000 (23:29 +0000)]
To save more power, switch to 10/100Mbps link when controller is
put into suspend/shutdown.  Old PCI controllers performed that
operation in firmware but for RTL8111C or newer controllers, it's
responsibility of driver.  It's not clear whether the firmware of
RTL8111B still downgrades its speed to 10/100Mbps so leave it as it
was.

12 years agoMake sure to stop TX MAC before freeing queued TX frames.
yongari [Wed, 23 Nov 2011 22:07:13 +0000 (22:07 +0000)]
Make sure to stop TX MAC before freeing queued TX frames.
For RTL8111DP, check if the TX MAC is active by reading RL_GTXSTART
register.  For RTL8402/8168E-VL/8168F/8411, wait until TX queue is
empty.

12 years agoWrap BCM5785 in #ifdef notyet for now. According to yongari@ there are
marius [Wed, 23 Nov 2011 22:05:44 +0000 (22:05 +0000)]
Wrap BCM5785 in #ifdef notyet for now. According to yongari@ there are
issues probably needing workarounds in bge(4) when brgphy(4) handles this
PHY. Letting ukphy(4) handle it instead results in a working configuration,
although likely with performance penalties.

12 years ago- Just use cam_calc_geometry(9) on newer version of FreeBSD rather than
marius [Wed, 23 Nov 2011 21:43:51 +0000 (21:43 +0000)]
- Just use cam_calc_geometry(9) on newer version of FreeBSD rather than
  duplicating it.
- In hptmv(4) and hptrr(4) use __FBSDID and DEVMETHOD_END.

12 years agoUse DEVMETHOD_END.
marius [Wed, 23 Nov 2011 20:27:26 +0000 (20:27 +0000)]
Use DEVMETHOD_END.

12 years agoProbe the BCM5785.
marius [Wed, 23 Nov 2011 20:09:34 +0000 (20:09 +0000)]
Probe the BCM5785.

Obtained from: NetBSD

12 years agoSync with NetBSD rev. 1.104
marius [Wed, 23 Nov 2011 20:08:56 +0000 (20:08 +0000)]
Sync with NetBSD rev. 1.104

Obtained from: NetBSD

12 years agoRemove unused functions.
fjoe [Wed, 23 Nov 2011 19:11:03 +0000 (19:11 +0000)]
Remove unused functions.

12 years ago- Remove unused old libdialog includes
fjoe [Wed, 23 Nov 2011 19:06:30 +0000 (19:06 +0000)]
- Remove unused old libdialog includes
- Remove unused functions

12 years agoFix parsing of redirect_addr argument.
glebius [Wed, 23 Nov 2011 18:38:08 +0000 (18:38 +0000)]
Fix parsing of redirect_addr argument.

PR: kern/162739
MFC after: 3 days

12 years agoAvoid double free creating a new RAID with invalid command line arguments.
emaste [Wed, 23 Nov 2011 17:02:27 +0000 (17:02 +0000)]
Avoid double free creating a new RAID with invalid command line arguments.

Submitted by: Xin Huang <xhuang sandvine com>
Reviewed by: rstone@
MFC after: 1 week

12 years agosome tweaks to build picobsd for different architectures.
luigi [Wed, 23 Nov 2011 12:05:39 +0000 (12:05 +0000)]
some tweaks to build picobsd for different architectures.

12 years agoPlug fd leaks
kevlo [Wed, 23 Nov 2011 10:27:18 +0000 (10:27 +0000)]
Plug fd leaks

12 years agofix formatting warning using casts. The numbers involved
luigi [Wed, 23 Nov 2011 09:45:48 +0000 (09:45 +0000)]
fix formatting warning using casts. The numbers involved
are small and these are debug statements, so there is no reason to
obfuscate the format string with PRIsomeKINDofINTEGER

12 years agoFix build without INVARIANTS.
trociny [Wed, 23 Nov 2011 08:11:04 +0000 (08:11 +0000)]
Fix build without INVARIANTS.

Discussed with: kib

12 years agoFix build, hopefully.
trociny [Wed, 23 Nov 2011 07:34:09 +0000 (07:34 +0000)]
Fix build, hopefully.

Reviewed by: kib

12 years agoRe-lock the ath lock after ath_reset() has been called.
adrian [Wed, 23 Nov 2011 07:12:26 +0000 (07:12 +0000)]
Re-lock the ath lock after ath_reset() has been called.
The calibrate callout is done with the sc lock held.

This only showed up when using an older NIC (AR5212) whose
radio/phy requires the rfgain adjustment.

Pointy-hat-to: adrian
Sponsored by: Hobnob, Inc.

12 years agoRemove unused variable mii.
kevlo [Wed, 23 Nov 2011 05:34:01 +0000 (05:34 +0000)]
Remove unused variable mii.
This variable is initialized but not used.

Reviewed by: yongari

12 years agoTidy up the statistic documentation.
adrian [Wed, 23 Nov 2011 05:03:27 +0000 (05:03 +0000)]
Tidy up the statistic documentation.

Sponsored by: Hobnob, Inc.

12 years agoAdd the new statistics introduced in r227868.
adrian [Wed, 23 Nov 2011 05:01:23 +0000 (05:01 +0000)]
Add the new statistics introduced in r227868.

Sponsored by: Hobnob, Inc.

12 years agoFlesh out the TX aggregation completion statistics.
adrian [Wed, 23 Nov 2011 05:00:25 +0000 (05:00 +0000)]
Flesh out the TX aggregation completion statistics.

* Failall is now named just that.
* Add TX ok and TX fail, for aggregate frame sub-frames.

This will break athstats; a followup commit wil resolve this.

Sponsored by: Hobnob, Inc.

12 years agoDisable accepting frames in re_stop() to put RX MAC into idle state.
yongari [Wed, 23 Nov 2011 02:08:05 +0000 (02:08 +0000)]
Disable accepting frames in re_stop() to put RX MAC into idle state.
Because there is no reliable way to know whether RX MAC is in
stopped state, rejecting all frames would be the only way to
minimize possible races.
Otherwise it's possible to receive frames while stop command
execution is in progress and controller can DMA the frame to freed
RX buffer during that period.
This was observed on recent PCIe controllers(i.e. RTL8111F).

While this change may not be required on old controllers it
wouldn't make negative effects on old controllers.  One side effect
of this change is disabling receive so driver reprograms RL_RXCFG
to receive WOL frames when it is put into suspend or shutdown.

This should address occasional 'memory modified free' errors seen
on recent RealTek controllers.

12 years agofdopendir(): Do not close the passed file descriptor on failure.
jilles [Tue, 22 Nov 2011 23:46:56 +0000 (23:46 +0000)]
fdopendir(): Do not close the passed file descriptor on failure.

Reviewed by: delphij

12 years agoPerform media change after setting IFF_DRV_RUNNING flag. Without it,
yongari [Tue, 22 Nov 2011 23:27:59 +0000 (23:27 +0000)]
Perform media change after setting IFF_DRV_RUNNING flag. Without it,
driver would ignore the first link state update if controller
already established a link such that it would have to take
additional link state handling in re_tick().

12 years agoWriting access to RL_CFG5 register also requires EEPROM write
yongari [Tue, 22 Nov 2011 23:19:49 +0000 (23:19 +0000)]
Writing access to RL_CFG5 register also requires EEPROM write
access.
While I'm here, enable WOL through magic packet but disable waking
up system via unicast, multicast and broadcast frames.  Otherwise,
multicast or unicast frame(e.g. ICMP echo request) can wake up
system which is not probably wanted behavior on most environments.
This was not known as problem because RL_CFG5 register access had
not effect until this change.
The capability to wake up system with unicast/multicast frames
are still set in driver, default off, so users who need that
feature can still activate it with ifconfig(8).

12 years agoRename device_delete_all_children() into device_delete_children().
hselasky [Tue, 22 Nov 2011 21:56:55 +0000 (21:56 +0000)]
Rename device_delete_all_children() into device_delete_children().

Suggested by: jhb @ and marius @
MFC after: 1 week

12 years agos,KOBJMETHOD_END,DEVMETHOD_END,g in order to fully hide the explicit mention
marius [Tue, 22 Nov 2011 21:55:40 +0000 (21:55 +0000)]
s,KOBJMETHOD_END,DEVMETHOD_END,g in order to fully hide the explicit mention
of kobj(9) from device drivers.

12 years agoStyle change.
hselasky [Tue, 22 Nov 2011 21:53:19 +0000 (21:53 +0000)]
Style change.

Suggested by: jhb @ and marius @
MFC after: 1 week

12 years agoRemove yet another outdated note about procfs(5) being required.
trociny [Tue, 22 Nov 2011 21:53:06 +0000 (21:53 +0000)]
Remove yet another outdated note about procfs(5) being required.

Spotted by: arundel

12 years agoforgot to merge NETMAP entries in sys/conf !
luigi [Tue, 22 Nov 2011 21:50:38 +0000 (21:50 +0000)]
forgot to merge NETMAP entries in sys/conf !

12 years agoUpdate to use DEVMETHOD_END.
marius [Tue, 22 Nov 2011 21:49:29 +0000 (21:49 +0000)]
Update to use DEVMETHOD_END.

12 years ago- There's no need to overwrite the default device method with the default
marius [Tue, 22 Nov 2011 21:28:20 +0000 (21:28 +0000)]
- There's no need to overwrite the default device method with the default
  one. Interestingly, these are actually the default for quite some time
  (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9)
  since r52045) but even recently added device drivers do this unnecessarily.
  Discussed with: jhb, marcel
- While at it, use DEVMETHOD_END.
  Discussed with: jhb
- Also while at it, use __FBSDID.

12 years agoFor IP1001 PHY, do not set multi-port device(MASTER). Ideally this
yongari [Tue, 22 Nov 2011 21:22:06 +0000 (21:22 +0000)]
For IP1001 PHY, do not set multi-port device(MASTER).  Ideally this
bit should not affect link establishment process of auto-negotiation
if manual configuration is not used, which is true in auto-negotiation.
However it seems setting this bit interfere with IP1001 PHY's
down-shifting feature such that establishing a 10/100Mbps link failed
when 1000baseT link is not available during auto-negotiation process.

Tested by: Andrey Smagin <samspeed <> mail dot ru >

12 years agoRemove libpam from _prebuild_libs. This should unbreak the -jX build.
des [Tue, 22 Nov 2011 21:18:14 +0000 (21:18 +0000)]
Remove libpam from _prebuild_libs.  This should unbreak the -jX build.

MFC after: 3 weeks

12 years agoNo need in procfs(5).
trociny [Tue, 22 Nov 2011 21:14:46 +0000 (21:14 +0000)]
No need in procfs(5).

MFC after: 2 weeks

12 years agoNow kvm_getenvv() and kvm_getargv() don't need procfs(5).
trociny [Tue, 22 Nov 2011 21:12:28 +0000 (21:12 +0000)]
Now kvm_getenvv() and kvm_getargv() don't need procfs(5).

MFC after: 2 weeks

12 years agoAdd new options, -e and -x, to display process environment variables
trociny [Tue, 22 Nov 2011 20:59:52 +0000 (20:59 +0000)]
Add new options, -e and -x, to display process environment variables
and ELF auxiliary vectors.

MFC after: 2 weeks

12 years agoAnnounce flow control capability to underlying PHY driver.
yongari [Tue, 22 Nov 2011 20:57:06 +0000 (20:57 +0000)]
Announce flow control capability to underlying PHY driver.
Pause timer value is initialized to 0xFFFF. Controller allows just
4 different TX pause thresholds. The lowest possible threshold
value looks too aggressive so use next available threshold value.

12 years agoRetire linprocfs_doargv(). Instead use new functions, proc_getargv()
trociny [Tue, 22 Nov 2011 20:45:11 +0000 (20:45 +0000)]
Retire linprocfs_doargv(). Instead use new functions, proc_getargv()
and proc_getenvv(), which were implemented using linprocfs_doargv() as
a reference.

Suggested by: kib
Reviewed by: kib
Approved by: des (linprocfs maintainer)
MFC after: 2 weeks

12 years agoRework link establishment and link state detection logic.
yongari [Tue, 22 Nov 2011 20:45:09 +0000 (20:45 +0000)]
Rework link establishment and link state detection logic.
 - Remove MIIBUS statchg callback and program VGE_DIAGCTL before
   initiating link establishment.  Previously driver used to
   program VGE_DIAGCTL after getting a link in statchg callback.
   It seems the VGE_DIAGCTL register works like a kind of MII
   register such that it requires setting a 'to be' mode in advance
   rather than relying on resolved speed/duplex of established link.
   This means the statchg callback is not needed in driver.  In
   addition, if there was no link at the time of media change, this
   was not called at all.
 - Introduce vge_ifmedia_upd_locked() to change current media to
   configured one.  Actual media change is performed only after PHY
   reset and VGE_DIAGCTL setup.
 - In WOL configuration, make sure to clear forced mode such that
   controller can rely on auto-negotiation.
 - Unlike most other drivers that use miibus(4), vge(4) used
   controller's auto-polling feature for link state tracking via
   interrupt.  This came from controller's inefficient mechanism to
   access MII registers.  On link state change interrupt, vge(4)
   used to get current link state with series of MII register
   accesses.  Because vge(4) already enabled auto polling, read PHY
   status register to resolved speed/duplex/flow control parameters.

vge(4) still does not drive MII_TICK to reduce number of MII
register accesses which in turn means the driver does not know the
status of auto-negotiation.  This was a one of long standing
issue of vge(4).  Probably driver may be able to implement a timer
that keeps track of auto-negotiation state and restart
auto-negotiation when driver couldn't establish a link within a
specified period.  However the controller does not provide a
reliable way to detect auto-negotiation failure so I'm not sure
whether it's worth to implement it in driver.

Alternatively driver can completely disable MII auto-polling and
let miibus(4) poll link state by driving MII_TICK.  This may reduce
unnecessary overhead of stopping/restarting MII auto-polling of
controller.  Unfortunately it was known that some variants of
controller does not work correctly if MII auto-polling is disabled.

12 years agoIn procfs_doproccmdline() if arguments are not cashed read them from
trociny [Tue, 22 Nov 2011 20:43:03 +0000 (20:43 +0000)]
In procfs_doproccmdline() if arguments are not cashed read them from
the process stack.

Suggested by: kib
Reviewed by: kib
Tested by: pho
MFC after: 2 weeks

12 years agoAdd new sysctls, KERN_PROC_ENV and KERN_PROC_AUXV, to return
trociny [Tue, 22 Nov 2011 20:40:18 +0000 (20:40 +0000)]
Add new sysctls, KERN_PROC_ENV and KERN_PROC_AUXV, to return
environment strings and ELF auxiliary vectors from a process stack.

Make sysctl_kern_proc_args to read not cached arguments from the
process stack.

Export proc_getargv() and proc_getenvv() so they can be reused by
procfs and linprocfs.

Suggested by: kib
Reviewed by: kib
Discussed with: kib, rwatson, jilles
Tested by: pho
MFC after: 2 weeks

12 years agoImprove logging:
glebius [Tue, 22 Nov 2011 19:42:17 +0000 (19:42 +0000)]
Improve logging:
- don't hardcode function name
- use LOG_DEBUG for such a debug message
- print error value

12 years agostyle(9) nit
glebius [Tue, 22 Nov 2011 19:39:27 +0000 (19:39 +0000)]
style(9) nit

12 years agoFix SIOCDIFADDR semantics: if no address is specified, then delete first one.
glebius [Tue, 22 Nov 2011 19:37:57 +0000 (19:37 +0000)]
Fix SIOCDIFADDR semantics: if no address is specified, then delete first one.

12 years ago- Add a DEVMETHOD_END alias for KOBJMETHOD_END so that along with 'driver_t'
marius [Tue, 22 Nov 2011 19:31:43 +0000 (19:31 +0000)]
- Add a DEVMETHOD_END alias for KOBJMETHOD_END so that along with 'driver_t'
  and DEVMETHOD() we can fully hide the explicit mention of kobj(9) from
  device drivers.
- Update the example in driver.9 to use DEVMETHOD_END.

Submitted by: jhb
MFC after: 3 days

12 years agoAlways start MII auto polling before accessing any MII registers.
yongari [Tue, 22 Nov 2011 18:58:39 +0000 (18:58 +0000)]
Always start MII auto polling before accessing any MII registers.

12 years agoDefine __FreeBSD_kernel__ macro in sys/param.h.
rmh [Tue, 22 Nov 2011 18:53:54 +0000 (18:53 +0000)]
Define __FreeBSD_kernel__ macro in sys/param.h.

__FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
which by definition is always true on FreeBSD. This macro is also defined
on other systems that use the kernel of FreeBSD, such as GNU/kFreeBSD.

It is tempting to use this macro in userland code when we want to enable
kernel-specific routines, and in fact it's fine to do this in code that
is part of FreeBSD itself.  However, be aware that as presence of this
macro is still not widespread (e.g. older FreeBSD versions, 3rd party
compilers, etc), it is STRONGLY DISCOURAGED to check for this macro in
external applications without also checking for __FreeBSD__ as an
alternative.

Approved by: kib (mentor)
MFC after: 2 weeks

12 years agoAppend unit number to the WMI status device name to allow attaching
jh [Tue, 22 Nov 2011 16:44:50 +0000 (16:44 +0000)]
Append unit number to the WMI status device name to allow attaching
multiple acpi_wmi(4) instances.

PR: kern/162491
Reviewed by: avg

12 years agoAvoid panics from recursive rename operations. Not a perfect patch but
ivoras [Tue, 22 Nov 2011 16:18:12 +0000 (16:18 +0000)]
Avoid panics from recursive rename operations. Not a perfect patch but
good enough for now.

PR: kern/159418
Submitted by: Gleb Kurtsou
Reviewed by: kib
MFC after: 1 month

12 years agoFix a crash when trying to duplicate a locale that contains some implicit C locale...
theraven [Tue, 22 Nov 2011 14:11:42 +0000 (14:11 +0000)]
Fix a crash when trying to duplicate a locale that contains some implicit C locale components.

Reported by: Michael Butler
Approved by: dim (mentor)

12 years agoPut all the messages from msdosfs under the MSDOSFS_DEBUG ifdef.
kib [Tue, 22 Nov 2011 13:30:36 +0000 (13:30 +0000)]
Put all the messages from msdosfs under the MSDOSFS_DEBUG ifdef.
They are confusing to user, and not informative for general consumption.

MFC after: 1 week

12 years agoRemove the wrong comment about ufs not being loadable.
kib [Tue, 22 Nov 2011 13:27:53 +0000 (13:27 +0000)]
Remove the wrong comment about ufs not being loadable.
Note that only root filesystem module needs to be available
before root is mounted.

MFC after: 1 week

12 years ago- Use ppb_assert_locked() rather than using explicit mtx_assert call
attilio [Tue, 22 Nov 2011 11:35:24 +0000 (11:35 +0000)]
- Use ppb_assert_locked() rather than using explicit mtx_assert call
- Make ppbus code agnostic in regard of INVARIANTS option

MFC after: 2 weeks

12 years ago- fix some style(9) nits with my last commit
eadler [Tue, 22 Nov 2011 02:50:24 +0000 (02:50 +0000)]
- fix some style(9) nits with my last commit
- add a comment explaining why I used '|' instead of '||'

Submitted by: danfe@
Approved by: emaste@

12 years agoThis patch enables the new/default NFS server's use of shared
rmacklem [Tue, 22 Nov 2011 00:35:30 +0000 (00:35 +0000)]
This patch enables the new/default NFS server's use of shared
vnode locking for read, readdir, readlink, getattr and access.
It is hoped that this will improve server performance for these
operations, since they will no longer be serialized for a given
file/vnode.

12 years ago- add check for pointer equality prior to performing the O(n) pass
eadler [Tue, 22 Nov 2011 00:07:53 +0000 (00:07 +0000)]
- add check for pointer equality prior to performing the O(n) pass
- while here change 's' to 's1' in strcoll

Submitted by: eadler@
Reviewed by: theraven@
Approved by: brooks@
MFC after: 2 weeks

12 years ago(Hopefully) Fix the build with clang by removing a typedef that's no longer needed.
theraven [Mon, 21 Nov 2011 23:32:14 +0000 (23:32 +0000)]
(Hopefully) Fix the build with clang by removing a typedef that's no longer needed.

Approved by: brooks (mentor)

12 years agoUse the correct lock when calling msleep().
adrian [Mon, 21 Nov 2011 22:57:28 +0000 (22:57 +0000)]
Use the correct lock when calling msleep().

This fixes panics that users have been seeing when operating in station mode,
where the interface undergoes a lot more resets then in hostap mode (ie whilst
doing channel scanning.)

Reported by: arundel, wblock@wonkity.com
Sponsored by: Hobnob, Inc.

12 years agoThe DC calibration result obtained during initialization can't be
bschmidt [Mon, 21 Nov 2011 22:19:12 +0000 (22:19 +0000)]
The DC calibration result obtained during initialization can't be
passed over to the runtime firmware on 6050 devices. Instead let
the runtime firmware do the calibration itself. This fixes support
for the 6050 series devices.

Obtained from: OpenBSD
Submitted by: kevlo
Tested by: lx, Tz-Huan Huang(earlier version)

12 years agoFix some whitespace pollution.
adrian [Mon, 21 Nov 2011 21:59:01 +0000 (21:59 +0000)]
Fix some whitespace pollution.

12 years agoRevert back to revision 227649 because of license uncertainity.
mm [Mon, 21 Nov 2011 20:33:18 +0000 (20:33 +0000)]
Revert back to revision 227649 because of license uncertainity.

Manual pages from OpenSolaris svn_134 are still properly CDDL licensed
but I have been informed that the parts from s11ex are uncertain even
if they contain a CDDL header.

12 years agoImprove the way to calculate available pages in tmpfs:
delphij [Mon, 21 Nov 2011 20:26:22 +0000 (20:26 +0000)]
Improve the way to calculate available pages in tmpfs:

 - Don't deduct wired pages from total usable counts because it does not
   make any sense.  To make things worse, on systems where swap size is
   smaller than physical memory and use a lot of wired pages (e.g. ZFS),
   tmpfs can suddenly have free space of 0 because of this;
 - Count cached pages as available; [1]
 - Don't count inactive pages as available, technically we could but that
   might be too aggressive; [1]

[1] Suggested by kib@

MFC after: 1 week