Commit Graph

166655 Commits

Author SHA1 Message Date
Kevin Lo
c2c400aca1 Remove unused variable mii.
This variable is initialized but not used.

Reviewed by:	yongari
2011-11-23 05:34:01 +00:00
Adrian Chadd
317d14cf46 Tidy up the statistic documentation.
Sponsored by:	Hobnob, Inc.
2011-11-23 05:03:27 +00:00
Adrian Chadd
1df8da4c64 Add the new statistics introduced in r227868.
Sponsored by:	Hobnob, Inc.
2011-11-23 05:01:23 +00:00
Adrian Chadd
2d3d4776cd 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.
2011-11-23 05:00:25 +00:00
Pyun YongHyeon
fcb220acd1 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.
2011-11-23 02:08:05 +00:00
Jilles Tjoelker
38574aa8df fdopendir(): Do not close the passed file descriptor on failure.
Reviewed by:	delphij
2011-11-22 23:46:56 +00:00
Pyun YongHyeon
1662c49e56 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().
2011-11-22 23:27:59 +00:00
Pyun YongHyeon
44f7cbf586 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).
2011-11-22 23:19:49 +00:00
Hans Petter Selasky
3b12bdb58f Rename device_delete_all_children() into device_delete_children().
Suggested by:	jhb @ and marius @
MFC after:	1 week
2011-11-22 21:56:55 +00:00
Marius Strobl
848e30ff51 s,KOBJMETHOD_END,DEVMETHOD_END,g in order to fully hide the explicit mention
of kobj(9) from device drivers.
2011-11-22 21:55:40 +00:00
Hans Petter Selasky
5b288d2abf Style change.
Suggested by:	jhb @ and marius @
MFC after:	1 week
2011-11-22 21:53:19 +00:00
Mikolaj Golub
6edf5accb6 Remove yet another outdated note about procfs(5) being required.
Spotted by:	arundel
2011-11-22 21:53:06 +00:00
Luigi Rizzo
e4b68814b1 forgot to merge NETMAP entries in sys/conf ! 2011-11-22 21:50:38 +00:00
Marius Strobl
a9029fbb59 Update to use DEVMETHOD_END. 2011-11-22 21:49:29 +00:00
Marius Strobl
4b7ec27007 - 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.
2011-11-22 21:28:20 +00:00
Pyun YongHyeon
21c8beb9fd 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 >
2011-11-22 21:22:06 +00:00
Dag-Erling Smørgrav
8e2a5aa10c Remove libpam from _prebuild_libs. This should unbreak the -jX build.
MFC after:	3 weeks
2011-11-22 21:18:14 +00:00
Mikolaj Golub
57c87bfabb No need in procfs(5).
MFC after:	2 weeks
2011-11-22 21:14:46 +00:00
Mikolaj Golub
ee5169dc9d Now kvm_getenvv() and kvm_getargv() don't need procfs(5).
MFC after:	2 weeks
2011-11-22 21:12:28 +00:00
Mikolaj Golub
e99272c732 Add new options, -e and -x, to display process environment variables
and ELF auxiliary vectors.

MFC after:	2 weeks
2011-11-22 20:59:52 +00:00
Pyun YongHyeon
17ff418d13 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.
2011-11-22 20:57:06 +00:00
Mikolaj Golub
7a837e17ba 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
2011-11-22 20:45:11 +00:00
Pyun YongHyeon
66c6108d5d 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.
2011-11-22 20:45:09 +00:00
Mikolaj Golub
beb7471b16 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
2011-11-22 20:43:03 +00:00
Mikolaj Golub
c5cfcb1c19 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
2011-11-22 20:40:18 +00:00
Gleb Smirnoff
c0ba290b5f Improve logging:
- don't hardcode function name
- use LOG_DEBUG for such a debug message
- print error value
2011-11-22 19:42:17 +00:00
Gleb Smirnoff
e278f44bb5 style(9) nit 2011-11-22 19:39:27 +00:00
Gleb Smirnoff
bbaa3f944e Fix SIOCDIFADDR semantics: if no address is specified, then delete first one. 2011-11-22 19:37:57 +00:00
Marius Strobl
788a85e884 - 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
2011-11-22 19:31:43 +00:00
Pyun YongHyeon
471ad1d097 Always start MII auto polling before accessing any MII registers. 2011-11-22 18:58:39 +00:00
Robert Millan
8326714bc1 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
2011-11-22 18:53:54 +00:00
David Chisnall
1828c5696f Import libcxxrt / libc++ into a vendor branch.
Approved by:	dim (mentor)
2011-11-22 17:30:41 +00:00
David Chisnall
6ec4e3f257 Import libcxxrt / libc++ into a vendor branch.
Approved by:	dim (mentor)
2011-11-22 17:30:41 +00:00
Jaakko Heinonen
885c97af51 Append unit number to the WMI status device name to allow attaching
multiple acpi_wmi(4) instances.

PR:		kern/162491
Reviewed by:	avg
2011-11-22 16:44:50 +00:00
Ivan Voras
6e92aee4e2 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
2011-11-22 16:18:12 +00:00
David Chisnall
2013459487 Fix a crash when trying to duplicate a locale that contains some implicit C locale components.
Reported by:	Michael Butler
Approved by:	dim (mentor)
2011-11-22 14:11:42 +00:00
Konstantin Belousov
54cf919857 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
2011-11-22 13:30:36 +00:00
Konstantin Belousov
3f850e6a25 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
2011-11-22 13:27:53 +00:00
Attilio Rao
b373cc4263 - Use ppb_assert_locked() rather than using explicit mtx_assert call
- Make ppbus code agnostic in regard of INVARIANTS option

MFC after:	2 weeks
2011-11-22 11:35:24 +00:00
Eitan Adler
623b87d8f4 - fix some style(9) nits with my last commit
- add a comment explaining why I used '|' instead of '||'

Submitted by:	danfe@
Approved by:	emaste@
2011-11-22 02:50:24 +00:00
Rick Macklem
6854d64811 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.
2011-11-22 00:35:30 +00:00
Eitan Adler
55e84fcee1 - 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
2011-11-22 00:07:53 +00:00
David Chisnall
a54626e0cd (Hopefully) Fix the build with clang by removing a typedef that's no longer needed.
Approved by:	brooks (mentor)
2011-11-21 23:32:14 +00:00
Adrian Chadd
a2d8240de5 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.
2011-11-21 22:57:28 +00:00
Bernhard Schmidt
26ddc9835a 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)
2011-11-21 22:19:12 +00:00
Adrian Chadd
5856d663ae Fix some whitespace pollution. 2011-11-21 21:59:01 +00:00
Martin Matuska
742bbc55b0 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.
2011-11-21 20:33:18 +00:00
Xin LI
296a25a245 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
2011-11-21 20:26:22 +00:00
Gleb Smirnoff
cf00e5c6b7 This check isn't needed now, sanity checking done in the beginning.
Missed it in last commit.
2011-11-21 20:07:12 +00:00
Warren Block
c05923c2a0 Correct and expand BSD partitioning scheme description.
Correct GUID to GPT in RECOVERING section.

Reviewed by:	ae
Approved by:	gjb (mentor)
MFC after:	1 week
2011-11-21 18:04:37 +00:00