]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years ago- Switch the "net.inet.tcp.reass.cursegments" and
Lawrence Stewart [Sat, 16 Oct 2010 05:37:45 +0000 (05:37 +0000)]
- Switch the "net.inet.tcp.reass.cursegments" and
  "net.inet.tcp.reass.maxsegments" sysctl variables to be based on UMA zone
  stats. The value returned by the cursegments sysctl is approximate owing to
  the way in which uma_zone_get_cur is implemented.

- Discontinue use of V_tcp_reass_qsize as a global reassembly segment count
  variable in the reassembly implementation. The variable was used without
  proper synchronisation and was duplicating accounting done by UMA already. The
  lack of synchronisation was particularly problematic on SMP systems
  terminating many TCP sessions, resulting in poor TCP performance for
  connections with non-zero packet loss.

Sponsored by: FreeBSD Foundation
Reviewed by: andre, gnn, rpaulo (as part of a larger patch)
MFC after: 2 weeks

13 years agoChange uma_zone_set_max to return the effective value of "nitems" after
Lawrence Stewart [Sat, 16 Oct 2010 04:41:45 +0000 (04:41 +0000)]
Change uma_zone_set_max to return the effective value of "nitems" after
rounding. The same value can also be obtained with uma_zone_get_max, but this
change avoids a caller having to make two back-to-back calls.

Sponsored by: FreeBSD Foundation
Reviewed by: gnn, jhb

13 years ago- Simplify implementation of uma_zone_get_max.
Lawrence Stewart [Sat, 16 Oct 2010 04:14:45 +0000 (04:14 +0000)]
- Simplify implementation of uma_zone_get_max.
- Add uma_zone_get_cur which returns the current approximate occupancy of
  a zone. This is useful for providing stats via sysctl amongst other things.

Sponsored by: FreeBSD Foundation
Reviewed by: gnn, jhb
MFC after: 2 weeks

13 years agoConvert the PHY drivers to honor the mii_flags passed down and convert
Marius Strobl [Fri, 15 Oct 2010 23:34:31 +0000 (23:34 +0000)]
Convert the PHY drivers to honor the mii_flags passed down and convert
the NIC drivers as well as the PHY drivers to take advantage of the
mii_attach() introduced in r213878 to get rid of certain hacks. For
the most part these were:
- Artificially limiting miibus_{read,write}reg methods to certain PHY
  addresses; we now let mii_attach() only probe the PHY at the desired
  address(es) instead.
- PHY drivers setting MIIF_* flags based on the NIC driver they hang
  off from, partly even based on grabbing and using the softc of the
  parent; we now pass these flags down from the NIC to the PHY drivers
  via mii_attach(). This got us rid of all such hacks except those of
  brgphy() in combination with bce(4) and bge(4), which is way beyond
  what can be expressed with simple flags.

While at it, I took the opportunity to change the NIC drivers to pass
up the error returned by mii_attach() (previously by mii_phy_probe())
and unify the error message used in this case where and as appropriate
as mii_attach() actually can fail for a number of reasons, not just
because of no PHY(s) being present at the expected address(es).

This file was missed in r213893.

13 years agoRemove unnecessary castings and fix couple of style(9) nits.
Jung-uk Kim [Fri, 15 Oct 2010 21:41:59 +0000 (21:41 +0000)]
Remove unnecessary castings and fix couple of style(9) nits.

13 years agoRemove two .endp's without matching .proc in lib/csu/ia64/crtn.S.
Dimitry Andric [Fri, 15 Oct 2010 21:40:20 +0000 (21:40 +0000)]
Remove two .endp's without matching .proc in lib/csu/ia64/crtn.S.
This allows it to assemble with newer binutils.

Reviewed by: marcel

13 years agoMove setting power state for children into a separate function as they were
Jung-uk Kim [Fri, 15 Oct 2010 21:39:51 +0000 (21:39 +0000)]
Move setting power state for children into a separate function as they were
essentially the same.  This also restores hw.pci.do_power_resume tunable,
which was broken since r211430.

Reviewed by: jhb

13 years agoAdd three new drivers for fan control and temperature reading on the
Andreas Tobler [Fri, 15 Oct 2010 20:08:16 +0000 (20:08 +0000)]
Add three new drivers for fan control and temperature reading on the
PowerMac7,2.

- The fcu driver lets us read and write the fan RPMs for all fans in the
  PowerMac7,2. This driver is PowerMac specific.
- The ds1775 is a driver to read the temperature for the drive bay sensor.
- The max6690 is another driver to read temperatures. Here it is used to
  read the inlet, the backside and the U3 heatsink temperature.

An additional driver, the ad7417, will follow later.

Thanks to nwhitehorn for guiding me through this driver development.

Approved by: nwhitehorn (mentor)

13 years agosh: Allow running 'prove' from tools/regression/bin/sh again
Jilles Tjoelker [Fri, 15 Oct 2010 20:01:35 +0000 (20:01 +0000)]
sh: Allow running 'prove' from tools/regression/bin/sh again
without needing to set special environment variables, testing the 'sh' from
PATH.

13 years agoNow that all previous users of mii_phy_probe() have been converted
Marius Strobl [Fri, 15 Oct 2010 15:46:58 +0000 (15:46 +0000)]
Now that all previous users of mii_phy_probe() have been converted
in r213893 and r213894 to use mii_attach() instead remove the former
and along with it the "EVIL HACK".

MFC after: never

13 years agoCurrently only opt_compat.h is included by the mps(4) driver. Also
Matthew D Fleming [Fri, 15 Oct 2010 15:24:59 +0000 (15:24 +0000)]
Currently only opt_compat.h is included by the mps(4) driver. Also
enable /dev/mps0, which was missing from my previous patches enabling
f/w upload and download.

opt_compat.h issue noticed by scottl.

13 years agoUpdate pmap_extract() to handle 1GB page mappings. Some device drivers
Alan Cox [Fri, 15 Oct 2010 15:23:34 +0000 (15:23 +0000)]
Update pmap_extract() to handle 1GB page mappings.  Some device drivers
use pmap_extract() rather than pmap_kextract() on direct map addresses.
Thus, pmap_extract() needs to be able to deal with 1GB page mappings if
we are to use 1GB page mappings for the direct map.  (See r197580.)

13 years agoRemove a device_printf() accidentally left in r213894.
Marius Strobl [Fri, 15 Oct 2010 15:16:36 +0000 (15:16 +0000)]
Remove a device_printf() accidentally left in r213894.

Submitted by: jhb

13 years agoConverted the remainder of the NIC drivers to use the mii_attach()
Marius Strobl [Fri, 15 Oct 2010 15:00:30 +0000 (15:00 +0000)]
Converted the remainder of the NIC drivers to use the mii_attach()
introduced in r213878 instead of mii_phy_probe(). Unlike r213893 these
are only straight forward conversions though.

Reviewed by: yongari

13 years agoConvert the PHY drivers to honor the mii_flags passed down and convert
Marius Strobl [Fri, 15 Oct 2010 14:52:11 +0000 (14:52 +0000)]
Convert the PHY drivers to honor the mii_flags passed down and convert
the NIC drivers as well as the PHY drivers to take advantage of the
mii_attach() introduced in r213878 to get rid of certain hacks. For
the most part these were:
- Artificially limiting miibus_{read,write}reg methods to certain PHY
  addresses; we now let mii_attach() only probe the PHY at the desired
  address(es) instead.
- PHY drivers setting MIIF_* flags based on the NIC driver they hang
  off from, partly even based on grabbing and using the softc of the
  parent; we now pass these flags down from the NIC to the PHY drivers
  via mii_attach(). This got us rid of all such hacks except those of
  brgphy() in combination with bce(4) and bge(4), which is way beyond
  what can be expressed with simple flags.

While at it, I took the opportunity to change the NIC drivers to pass
up the error returned by mii_attach() (previously by mii_phy_probe())
and unify the error message used in this case where and as appropriate
as mii_attach() actually can fail for a number of reasons, not just
because of no PHY(s) being present at the expected address(es).

Reviewed by: jhb, yongari

13 years agoPrevent the ofwdump manpage from being deleted by make delete-old on
Nathan Whitehorn [Fri, 15 Oct 2010 14:34:34 +0000 (14:34 +0000)]
Prevent the ofwdump manpage from being deleted by make delete-old on
PowerPC.

13 years agoStop hard coding nm(1) and make it overridable.
Jung-uk Kim [Thu, 14 Oct 2010 23:31:58 +0000 (23:31 +0000)]
Stop hard coding nm(1) and make it overridable.

13 years agoEmbellish this testcase a little bit to be more clear what the output is
David E. O'Brien [Thu, 14 Oct 2010 23:28:31 +0000 (23:28 +0000)]
Embellish this testcase a little bit to be more clear what the output is
and why.  The first case is correct usage which has but one correct output.
The 2nd and 3rd cases are incorrect usage in which the exact output is
not standardized and various shells give various allowable output.

13 years agoFixes to mps_user_command():
Matthew D Fleming [Thu, 14 Oct 2010 23:26:08 +0000 (23:26 +0000)]
Fixes to mps_user_command():
 - fix the leak of command struct on error
 - simplify the cleanup logic
 - EINPROGRESS is not a fatal error
 - buggy comment and error message

Reviewed by:   ken

13 years agoAdd new USB device IDs to the list of supported devices.
Hans Petter Selasky [Thu, 14 Oct 2010 22:14:55 +0000 (22:14 +0000)]
Add new USB device IDs to the list of supported devices.

PR: usb/151043
Approved by:    thompsa (mentor)

13 years ago- Add more USB devices to usbdevs and rename some previously unknown ones.
Hans Petter Selasky [Thu, 14 Oct 2010 22:06:52 +0000 (22:06 +0000)]
- Add more USB devices to usbdevs and rename some previously unknown ones.
- Add more USB mass storage quirks.

Submitted by: Dmitry Luhtionov
PR: usb/149934, usb/143045
Approved by:    thompsa (mentor)

13 years agoAdd a NetBSD-compatible mii_attach(), which is intended to eventually
Marius Strobl [Thu, 14 Oct 2010 22:01:40 +0000 (22:01 +0000)]
Add a NetBSD-compatible mii_attach(), which is intended to eventually
replace mii_phy_probe() altogether. Compared to the latter the advantages
of mii_attach() are:
- intended to be called multiple times in order to attach PHYs in multiple
  passes (f.e. in order to only use sub-ranges of the 0 to MII_NPHY - 1
  range)
- being able to pass along the capability mask from the NIC to the PHY
  drivers
- being able to specify at which address (phyloc) to probe for a PHY
  (instead of always probing at all addresses from 0 to MII_NPHY - 1)
- being able to specify which PHY instance (offloc) to attach
- being able to pass along MIIF_* flags from the NIC to the PHY drivers
  (f.e. as required to indicated to the PHY drivers that flow control is
  supported by the NIC driver, which actually is the motivation for this
  change).

While at it, I used the opportunity to get rid of some hacks in mii(4)
like miibus_probe() generally doing work besides sheer probing and the
"EVIL HACK" (which will vanish entirely along with mii_phy_probe()) by
passing the struct ifnet pointer via an argument of mii_attach() as well
as to fix some resource leaks in mii(4) in case something fails.
Commits which will update the PHY drivers to honor the MII flags passed
down from the NIC drivers and take advantage of mii_attach() to get rid
of certain types of hacks in NIC and PHY drivers as well as a conversion
of the remaining uses of mii_phy_probe() will follow shortly.

Reviewed by: jhb, yongari
Obtained from: NetBSD (partially)

13 years agoAdd more USB device IDs to supported list of devices.
Hans Petter Selasky [Thu, 14 Oct 2010 21:53:42 +0000 (21:53 +0000)]
Add more USB device IDs to supported list of devices.

Submitted by: Nick Hibma
PR: usb/149900
Approved by:    thompsa (mentor)

13 years agoUpdate manual with regarding to the status of calendars/calendar.judaic.
Edwin Groothuis [Thu, 14 Oct 2010 21:53:25 +0000 (21:53 +0000)]
Update manual with regarding to the status of calendars/calendar.judaic.

13 years agoExplicitly lower the PIL to 0 as part of enabling interrupts, similar to
Marius Strobl [Thu, 14 Oct 2010 21:46:53 +0000 (21:46 +0000)]
Explicitly lower the PIL to 0 as part of enabling interrupts, similar to
what is done on other platforms. Unlike as with the sched_throw(NULL)
called on BSPs during their startup apparently there's nothing which will
reliably lower it on APs. I'm unsure why this only came up on V215 though,
breaking these with r207248. My best guess is that these are the only
supported ones so far fast enough to loose some race.

PR: 151404
MFC after: 3 days

13 years agoFix forwarding of Line Register Status changes to TTY layer.
Hans Petter Selasky [Thu, 14 Oct 2010 21:45:41 +0000 (21:45 +0000)]
Fix forwarding of Line Register Status changes to TTY layer.

PR: usb/149675
Approved by:    thompsa (mentor)

13 years agoRemove unused EHCI register definition.
Hans Petter Selasky [Thu, 14 Oct 2010 21:41:08 +0000 (21:41 +0000)]
Remove unused EHCI register definition.
Define reserved EHCI register.

Approved by:    thompsa (mentor)

13 years agoRevert most of r197682 (EHCI Hardware BUG workaround). Implement
Hans Petter Selasky [Thu, 14 Oct 2010 21:38:06 +0000 (21:38 +0000)]
Revert most of r197682 (EHCI Hardware BUG workaround). Implement
proper solution which is to not use the TERMINATE pointer, but rather
link to a halted TD. The initial fix was due to a misunderstanding
about how the EHCI hardware works. Thanks to Alan Stern for clearing
this up. This patch can increase mass storage read performance
significantly when the IRQ rate is less than 8000 IRQ/s.

Approved by:    thompsa (mentor)

13 years ago- In the spirit of r212559 add a comment describing what will eventually
Marius Strobl [Thu, 14 Oct 2010 21:34:53 +0000 (21:34 +0000)]
- In the spirit of r212559 add a comment describing what will eventually
  lower the PIL.
- Just as with the AP ensure that the (S)TICK timer(s) are in a known
  state when starting BSPs.

13 years agoJust like xmphy(4) this driver doesn't use any of the generic subroutines
Marius Strobl [Thu, 14 Oct 2010 21:30:13 +0000 (21:30 +0000)]
Just like xmphy(4) this driver doesn't use any of the generic subroutines
so there's no need to fill mii_{ext,}capabilities either.

13 years agoAvoid using endless retransmission at EHCI hardware level, hence this hide
Hans Petter Selasky [Thu, 14 Oct 2010 21:26:06 +0000 (21:26 +0000)]
Avoid using endless retransmission at EHCI hardware level, hence this hide
errors from the applications. Only use endless retransmission while in the
non-addressed state on a High-Speed device.

Approved by:    thompsa (mentor)

13 years agoCorrect EHCI root HUB interface descriptor.
Hans Petter Selasky [Thu, 14 Oct 2010 21:18:18 +0000 (21:18 +0000)]
Correct EHCI root HUB interface descriptor.

Approved by:    thompsa (mentor)

13 years agoCorrect EHCI port register read.
Hans Petter Selasky [Thu, 14 Oct 2010 21:14:33 +0000 (21:14 +0000)]
Correct EHCI port register read.

Approved by:    thompsa (mentor)

13 years ago- Add more USB devices to usbdevs and rename some previously unknown ones.
Hans Petter Selasky [Thu, 14 Oct 2010 21:09:37 +0000 (21:09 +0000)]
- Add more USB devices to usbdevs and rename some previously unknown ones.
- Add more USB mass storage quirks.

Submitted by: Dmitry Luhtionov
PR: usb/149934, usb/143045
Approved by:    thompsa (mentor)

13 years ago- Add missing LibUSB API functions:
Hans Petter Selasky [Thu, 14 Oct 2010 20:50:33 +0000 (20:50 +0000)]
- Add missing LibUSB API functions:
  * libusb_strerror()
  * libusb_get_driver[_np]()
  * libusb_detach_kernel_driver[_np]()
- Factor out setting of non-blocking flag inside libusb.
- Add missing NULL check after libusb_get_device() call.
- Correct some wrong error codes due to copy and paste error.

PR: usb/150546
Submitted by: Robert Jenssen, Alexander Leidinger
Approved by:    thompsa (mentor)

13 years ago- Add support for LibUSB in 32-bit compatibility mode.
Hans Petter Selasky [Thu, 14 Oct 2010 20:38:18 +0000 (20:38 +0000)]
- Add support for LibUSB in 32-bit compatibility mode.

Approved by:    thompsa (mentor)

13 years ago- Fix some compile warnings regarding comparing signed to unsigned.
Hans Petter Selasky [Thu, 14 Oct 2010 20:18:39 +0000 (20:18 +0000)]
- Fix some compile warnings regarding comparing signed to unsigned.

Approved by:    thompsa (mentor)

13 years agoLibUSB (new API):
Hans Petter Selasky [Thu, 14 Oct 2010 20:04:36 +0000 (20:04 +0000)]
LibUSB (new API):
- Add a new API function to check the connected
status of the USB handle in the LibUSB v1.0 and
LibUSB v0.1 interfaces.

Approved by:    thompsa (mentor)

13 years agoRemove stale comment.
Konstantin Belousov [Thu, 14 Oct 2010 19:30:44 +0000 (19:30 +0000)]
Remove stale comment.

Submitted by: arundel
MFC after: 3 days

13 years agoRevert r213765. This is required because our build infrastructure uses
Rui Paulo [Thu, 14 Oct 2010 19:19:19 +0000 (19:19 +0000)]
Revert r213765. This is required because our build infrastructure uses
the host lex instead of the lex built during buildworld. I will MFC the
lex changes soon and in a few weeks this I'll commit again r213765.

13 years agoMake sure to not use stale ip/tcp header pointers. The ip/tcp
Pyun YongHyeon [Thu, 14 Oct 2010 18:31:40 +0000 (18:31 +0000)]
Make sure to not use stale ip/tcp header pointers. The ip/tcp
header parser uses m_pullup(9) to get access to mbuf chain.
m_pullup(9) can allocate new mbuf chain and free old one if the
space left in the mbuf chain is not enough to hold requested
contiguous bytes. Previously drivers can use stale ip/tcp header
pointer if m_pullup(9) returned new mbuf chain.

Reported by: Andrew Boyer (aboyer <> averesystems dot com)
MFC after: 10 days

13 years agoBackout r204230. TX mbuf parser for VLAN is still required to
Pyun YongHyeon [Thu, 14 Oct 2010 17:57:52 +0000 (17:57 +0000)]
Backout r204230. TX mbuf parser for VLAN is still required to
enable TX checksum offloading if VLAN hardware tagging is disabled.

13 years agoIt seems some multi-port dc(4) controllers shares SROM of the first
Pyun YongHyeon [Thu, 14 Oct 2010 17:22:38 +0000 (17:22 +0000)]
It seems some multi-port dc(4) controllers shares SROM of the first
port such that reading station address from second port always
returned 0xFF:0xFF:0xFF:0xFF:0xFF:0xFF Unfortunately it seems there
is no easy way to know whether SROM is shared or not. Workaround
the issue by traversing dc(4) device list and see whether we're
using second port and use station address of controller 0 as base
station address of second port.

PR: kern/79262
MFC after: 2 weeks

13 years agoSupport firmware download.
Matthew D Fleming [Thu, 14 Oct 2010 16:44:44 +0000 (16:44 +0000)]
Support firmware download.

13 years agoRe-work the internals of adding items to the driver's scatter-gather
Matthew D Fleming [Thu, 14 Oct 2010 16:44:05 +0000 (16:44 +0000)]
Re-work the internals of adding items to the driver's scatter-gather
list.  Use the new internals to simplify adding transaction context
elements, and in future diffs, more complicated SGLs.

13 years agoRemove dead code:
Bjoern A. Zeeb [Thu, 14 Oct 2010 15:15:22 +0000 (15:15 +0000)]
Remove dead code:
assignment to a local variable not used anywhere after that.

MFC after: 3 days

13 years agoStyle: make the asterisk go with the variable name, not the type.
Bjoern A. Zeeb [Thu, 14 Oct 2010 14:49:49 +0000 (14:49 +0000)]
Style: make the asterisk go with the variable name, not the type.

MFC after: 3 days

13 years agoAdd FreeBSD 8.2.
Jaakko Heinonen [Thu, 14 Oct 2010 14:48:11 +0000 (14:48 +0000)]
Add FreeBSD 8.2.

Reviewed by: ru
MFC after: 3 days

13 years agoUse ifa_ifwithaddr_check() rather than ifa_ifwithaddr() as we are not
Bjoern A. Zeeb [Thu, 14 Oct 2010 12:32:49 +0000 (12:32 +0000)]
Use ifa_ifwithaddr_check() rather than ifa_ifwithaddr() as we are not
interested in the result and would leak a reference otherwise.

PR: kern/151435
Submitted by: Andrew Boyer (aboyer averesystems.com)
MFC after: 3 days

13 years agoEnable the shared memory reference clock driver. The GPS devices are
Gleb Smirnoff [Thu, 14 Oct 2010 11:20:23 +0000 (11:20 +0000)]
Enable the shared memory reference clock driver. The GPS devices are
getting more and more popular, as source of precise time, and the gpsd
daemon from ports is using the shared memory to synchronize with ntpd.

Reviewed by: roberto

13 years agoIn kern_sigtimedwait(), move initialization code out of process lock,
David Xu [Thu, 14 Oct 2010 08:01:33 +0000 (08:01 +0000)]
In kern_sigtimedwait(), move initialization code out of process lock,
instead of using SIGISMEMBER to test every interesting signal, just
unmask the signal set and let cursig() return one, get the signal
after it returns, call reschedule_signal() after signals are blocked
again.

In kern_sigprocmask(), don't call reschedule_signal() when it is
unnecessary.

In reschedule_signal(), replace SIGISEMPTY() + SIGISMEMBER() with
sig_ffs(), rename variable 'i' to sig.

13 years agoWe only need to look as far as '..' to find 'test/'.
David E. O'Brien [Wed, 13 Oct 2010 23:31:17 +0000 (23:31 +0000)]
We only need to look as far as '..' to find 'test/'.

13 years agoDo not assume in growstackstr() that a "precious" character will be
David E. O'Brien [Wed, 13 Oct 2010 23:29:09 +0000 (23:29 +0000)]
Do not assume in growstackstr() that a "precious" character will be
immediately written into the stack after the call.  Instead let the caller
manage the "space left".

Previously, growstackstr()'s assumption causes problems with STACKSTRNUL()
where we want to be able to turn a stack into a C string, and later
pretend the NUL is not there.

This fixes a bug in STACKSTRNUL() (that grew the stack) where:
1. STADJUST() called after a STACKSTRNUL() results in an improper adjust.
   This can be seen in ${var%pattern} and ${var%%pattern} evaluation.
2. Memory leak in STPUTC() called after a STACKSTRNUL().

Reviewed by: jilles

13 years agoUse a safer mechanism for determining if a task is currently running,
Matthew D Fleming [Wed, 13 Oct 2010 22:59:04 +0000 (22:59 +0000)]
Use a safer mechanism for determining if a task is currently running,
that does not rely on the lifetime of pointers being the same. This also
restores the task KBI.

Suggested by: jhb
MFC after: 1 month

13 years agoFix a regression introduced in r213710. r213710 removed the use of
Pyun YongHyeon [Wed, 13 Oct 2010 22:29:48 +0000 (22:29 +0000)]
Fix a regression introduced in r213710. r213710 removed the use of
auto polling such that it made all controllers obtain link status
information from the state of the LNKRDY input signal. Broadcom
recommends disabling auto polling such that driver should rely on
PHY interrupts for link status change indications. Unfortunately it
seems some controllers(BCM5703, BCM5704 and BCM5705) have PHY
related issues so Linux took other approach to workaround it.
bge(4) didn't follow that and it used to enable auto polling to
workaround it. Restore this old behavior for BCM5700 family
controllers and BCM5705 to use auto polling. For BCM5700 and
BCM5701, it seems it does not need to enable auto polling but I
restored it for safety.
Special thanks to marius who tried lots of patches with patience.

Reported by: marius
Tested by: marius

13 years agoIn the spirit of r90111, depend on c89 and remove the "STATIC" macro
David E. O'Brien [Wed, 13 Oct 2010 22:18:03 +0000 (22:18 +0000)]
In the spirit of r90111, depend on c89 and remove the "STATIC" macro
and its usage.

13 years agodocument logging through bpf
Luigi Rizzo [Wed, 13 Oct 2010 22:07:57 +0000 (22:07 +0000)]
document logging through bpf

13 years agoUSB network (NCM driver):
Hans Petter Selasky [Wed, 13 Oct 2010 22:04:55 +0000 (22:04 +0000)]
USB network (NCM driver):
- correct the ethernet payload remainder which
must be post-offseted by -14 bytes instead of
0 bytes. This is not very clearly defined in the
NCM specification.
- add development feature about limiting the
maximum datagram count in each NCM payload.
- zero-pad alignment data
- add TX-interval tuning sysctl

Approved by:    thompsa (mentor)

13 years agoAdd more checks for resolved link speed in bge_miibus_statchg().
Pyun YongHyeon [Wed, 13 Oct 2010 21:53:37 +0000 (21:53 +0000)]
Add more checks for resolved link speed in bge_miibus_statchg().
Link UP state could be reported first before actual completion of
auto-negotiation. This change makes bge(4) reprogram BGE_MAC_MODE,
BGE_TX_MODE and BGE_RX_MODE register only after controller got a
valid link.

13 years agoKeep polling at 50hz as long as link state is changing.
Juli Mallett [Wed, 13 Oct 2010 21:45:56 +0000 (21:45 +0000)]
Keep polling at 50hz as long as link state is changing.

13 years agoMerge ACPICA 20101013.
Jung-uk Kim [Wed, 13 Oct 2010 21:37:02 +0000 (21:37 +0000)]
Merge ACPICA 20101013.

13 years agoUSB Network:
Hans Petter Selasky [Wed, 13 Oct 2010 21:36:42 +0000 (21:36 +0000)]
USB Network:
- Add new driver for iPhone tethering
- Supports the iPhone 3G/3GS/4G ethernet protocol

Approved by:    thompsa (mentor)

13 years agoUSB WLAN:
Hans Petter Selasky [Wed, 13 Oct 2010 20:56:54 +0000 (20:56 +0000)]
USB WLAN:
- Add new device ID

PR: usb/150989
Approved by:    thompsa (mentor)

13 years agoUSB network (UHSO):
Hans Petter Selasky [Wed, 13 Oct 2010 20:51:06 +0000 (20:51 +0000)]
USB network (UHSO):
- Correct network interface flags.

PR: usb/149039
Submitted by: Fredrik Lindberg
Approved by:    thompsa (mentor)

13 years agoCorrect some root HUB descriptor fields in multiple controller drivers.
Hans Petter Selasky [Wed, 13 Oct 2010 20:37:19 +0000 (20:37 +0000)]
Correct some root HUB descriptor fields in multiple controller drivers.
Remove an unused structure.

Approved by:    thompsa (mentor)

13 years agoImport ACPICA 20101013.
Jung-uk Kim [Wed, 13 Oct 2010 20:35:34 +0000 (20:35 +0000)]
Import ACPICA 20101013.

13 years agos/sytem/system in comments, no functional changes.
Benedict Reuschling [Wed, 13 Oct 2010 20:08:02 +0000 (20:08 +0000)]
s/sytem/system in comments, no functional changes.

Reviewed by:    alfred@

13 years agoIf one wishes to set breakpoints of static the functions here, they
David E. O'Brien [Wed, 13 Oct 2010 18:23:43 +0000 (18:23 +0000)]
If one wishes to set breakpoints of static the functions here, they
cannot be inlined.

Submitted by: jhb

13 years agoChange two missed instances of 'retq' in aeskeys_i386.S to 'retl', which
Dimitry Andric [Wed, 13 Oct 2010 17:55:53 +0000 (17:55 +0000)]
Change two missed instances of 'retq' in aeskeys_i386.S to 'retl', which
makes it possible to assemble this file with gas from newer binutils.

Reviewed by: kib

13 years agoRewrite interrupt handler to give fairness for both RX and TX.
Pyun YongHyeon [Wed, 13 Oct 2010 17:55:19 +0000 (17:55 +0000)]
Rewrite interrupt handler to give fairness for both RX and TX.
Previously rl(4) continuously checked whether there are RX events
or TX completions in forever loop. This caused TX starvation under
high RX load as well as consuming too much CPU cycles in the
interrupt handler. If interrupt was shared with other devices which
may be always true due to USB devices in these days, rl(4) also
tried to process the interrupt. This means polling(4) was the only
way to mitigate the these issues.

To address these issues, rl(4) now disables interrupts when it
knows the interrupt is ours and limit the number of iteration of
the loop to 16. The interrupt would be enabled again before exiting
interrupt handler if the driver is still running. Because RX buffer
is 64KB in size, the number of iterations in the loop has nothing
to do with number of RX packets being processed. This change
ensures sending TX frames under high RX load.

RX handler drops a driver lock to pass received frames to upper
stack such that there is a window that user can down the interface.
So rl(4) now checks whether driver is still running before serving
RX or TX completion in the loop.

While I'm here, exit interrupt handler when driver initialized
controller.

With this change, now rl(4) can send frames under high RX load even
though the TX performance is still not good(rl(4) controllers can't
queue more than 4 frames at a time so low TX performance was one of
design issue of rl(4) controllers). It's much better than previous
TX starvation and you should not notice RX performance drop with
this change. Controller still shows poor performance under high
network load but for many cases it's now usable without resorting
to polling(4).

MFC after: 2 weeks

13 years agoRevert r213793.
Rui Paulo [Wed, 13 Oct 2010 17:38:23 +0000 (17:38 +0000)]
Revert r213793.

13 years agoWhen calling panic(), always pass a format string.
Rui Paulo [Wed, 13 Oct 2010 17:21:21 +0000 (17:21 +0000)]
When calling panic(), always pass a format string.

13 years agoDon't do a logical AND of the result of strcmp() with a constant.
Rui Paulo [Wed, 13 Oct 2010 17:17:50 +0000 (17:17 +0000)]
Don't do a logical AND of the result of strcmp() with a constant.

Found with: clang

13 years agoIgnore the return value of ADDCARRY().
Rui Paulo [Wed, 13 Oct 2010 17:16:08 +0000 (17:16 +0000)]
Ignore the return value of ADDCARRY().

13 years agoPass a format string to panic() and to taskqueue_start_threads().
Rui Paulo [Wed, 13 Oct 2010 17:13:43 +0000 (17:13 +0000)]
Pass a format string to panic() and to taskqueue_start_threads().

Found with: clang

13 years agoIn zfs_post_common(), use %d instead of %hhu.
Rui Paulo [Wed, 13 Oct 2010 17:12:23 +0000 (17:12 +0000)]
In zfs_post_common(), use %d instead of %hhu.

Found with: clang

13 years agoProperly tell the compiler that we want to ignore the return value of
Rui Paulo [Wed, 13 Oct 2010 17:09:53 +0000 (17:09 +0000)]
Properly tell the compiler that we want to ignore the return value of
certain macros.

13 years agoFix several cases were a conditional operator was used instead of a
Rui Paulo [Wed, 13 Oct 2010 17:09:16 +0000 (17:09 +0000)]
Fix several cases were a conditional operator was used instead of a
bitwise operator.

Found with: clang

13 years agoClean up unused headers.
Jung-uk Kim [Wed, 13 Oct 2010 17:06:25 +0000 (17:06 +0000)]
Clean up unused headers.

13 years agoActually, check for any kind of "C string type".
Roman Divacky [Wed, 13 Oct 2010 17:01:33 +0000 (17:01 +0000)]
Actually, check for any kind of "C string type".

Approved by:    rpaulo (mentor)

13 years agoClang related fixes:
Rui Paulo [Wed, 13 Oct 2010 16:57:06 +0000 (16:57 +0000)]
Clang related fixes:
* When calling syslog(), pass a format string.
* Define YY_NO_INPUT on nslexer.l

Submitted by: Norberto Lopes <nlopes.ml at gmail.com>

13 years agoRevert 212517 to restore pristine state of this file
Warner Losh [Wed, 13 Oct 2010 16:34:08 +0000 (16:34 +0000)]
Revert 212517 to restore pristine state of this file

13 years agoRemove acpi_bus_number() completely. It had to be removed in r212761.
Jung-uk Kim [Wed, 13 Oct 2010 16:30:41 +0000 (16:30 +0000)]
Remove acpi_bus_number() completely.  It had to be removed in r212761.

Pointed out by: jhb

13 years agoPass a format string to make_dev().
Rui Paulo [Wed, 13 Oct 2010 14:57:13 +0000 (14:57 +0000)]
Pass a format string to make_dev().

Found by: clang

13 years agoAdd opt_compat.h to SRCS.
Rui Paulo [Wed, 13 Oct 2010 14:44:38 +0000 (14:44 +0000)]
Add opt_compat.h to SRCS.

13 years agoPass a format string to make_dev().
Rui Paulo [Wed, 13 Oct 2010 14:41:52 +0000 (14:41 +0000)]
Pass a format string to make_dev().

13 years agoFix a brain-o: wrong case statement semantics.
Rui Paulo [Wed, 13 Oct 2010 14:39:54 +0000 (14:39 +0000)]
Fix a brain-o: wrong case statement semantics.

Found with: clang

13 years agoWPA_CSE_WEP104 was being incorrectly checked.
Rui Paulo [Wed, 13 Oct 2010 14:37:52 +0000 (14:37 +0000)]
WPA_CSE_WEP104 was being incorrectly checked.

Found with: clang

13 years agoExtend this check for const unsigned char *.
Roman Divacky [Wed, 13 Oct 2010 14:27:47 +0000 (14:27 +0000)]
Extend this check for const unsigned char *.

Approved by:    rpaulo (mentor)

13 years agoMake DEBUG traces 64-bit clean:
John Baldwin [Wed, 13 Oct 2010 13:22:11 +0000 (13:22 +0000)]
Make DEBUG traces 64-bit clean:
- Use %t to print ptrdiff_t values.
- Cast a ptrdiff_t value explicitly to int for a field width specifier.

While here, sort includes.

Submitted by: Garrett Cooper

13 years agoSuggest that DEBUG_FLAGS be used to enable extra debugging rather than
John Baldwin [Wed, 13 Oct 2010 13:17:38 +0000 (13:17 +0000)]
Suggest that DEBUG_FLAGS be used to enable extra debugging rather than
frobbing CFLAGS directly.  DEBUG_FLAGS is something that can be specified
on the make command line without having to edit the Makefile directly.

Submitted by: Garrett Cooper

13 years agoMark acpi_bus_number() as __unused. This allows clang to this file
Rui Paulo [Wed, 13 Oct 2010 11:38:24 +0000 (11:38 +0000)]
Mark acpi_bus_number() as __unused. This allows clang to this file
without any warnings.

13 years agoIgnore the return value of DE_INTERNALIZE().
Rui Paulo [Wed, 13 Oct 2010 11:37:39 +0000 (11:37 +0000)]
Ignore the return value of DE_INTERNALIZE().

13 years agoExplicitly tell the compiler that we don't care about the return value
Rui Paulo [Wed, 13 Oct 2010 11:37:12 +0000 (11:37 +0000)]
Explicitly tell the compiler that we don't care about the return value
of kbdd_ioctl().

13 years agoThe canonical way to print __func__ when using KASSERT() is to write
Rui Paulo [Wed, 13 Oct 2010 11:35:59 +0000 (11:35 +0000)]
The canonical way to print __func__ when using KASSERT() is to write
("%s", __func__). This avoids clang's -Wformat-string warnings.

13 years agoPurposely tell the compiler that we ignore the return value of ADDCARRY()
Rui Paulo [Wed, 13 Oct 2010 10:45:22 +0000 (10:45 +0000)]
Purposely tell the compiler that we ignore the return value of ADDCARRY()
in the REDUCE macro.

Reviewed by: dim, rdivacky

13 years agoDefine YY_NO_INPUT. This makes aicasm buildable by clang with Werror
Rui Paulo [Wed, 13 Oct 2010 10:33:01 +0000 (10:33 +0000)]
Define YY_NO_INPUT. This makes aicasm buildable by clang with Werror
turned on.

13 years agoDon't define the input() function ifdef YY_NO_INPUT.
Rui Paulo [Wed, 13 Oct 2010 10:31:32 +0000 (10:31 +0000)]
Don't define the input() function ifdef YY_NO_INPUT.

This was previously done for the input() function.

Submitted by: Norberto Lopes <nblopes.ml at gmail.com>

13 years agoUse the RFC2606 domain example.com in examples.
Rebecca Cran [Wed, 13 Oct 2010 09:33:26 +0000 (09:33 +0000)]
Use the RFC2606 domain example.com in examples.

13 years agoo) Make it possible to attach a PHY directly to an octe device rather than
Juli Mallett [Wed, 13 Oct 2010 09:17:44 +0000 (09:17 +0000)]
o) Make it possible to attach a PHY directly to an octe device rather than
   using miibus, since for some devices that use multiple addresses on the bus,
   going through miibus may be unclear, and for devices that are not standard
   MII PHYs, miibus may throw a fit, necessitating complicated interfaces to
   fake the interface that it expects during probe/attach.
o) Make the mv88e61xx SMI interface in octe attach a PHY directly and fix some
   mistakes in the code that resulted from trying too hard to present a nice
   interface to miibus.
o) Add a PHY driver for the mv88e61xx.  If attached (it is optional in kernel
   compiles so the default behavior of having a dumb switch is preserved) it
   will place the switch in a VLAN-tagging mode such that each physical port
   has a VLAN associated with it and interfaces for the VLANs can be created to
   address or bridge between them.
   XXX It would be nice for this to be part of a single module including the
       SMI interface, and for it to fit into a generic switch configuration
       framework and for it to use DSA rather than VLANs, but this is a start
       and gives some sense of the parameters of such frameworks that are not
       currently present in FreeBSD.  In lieu of a switch configuration
       interface, per-port media status and VLAN settings are in a sysctl tree.
   XXX There may be some minor nits remaining in the handling of broadcast,
       multicast and unknown destination traffic.  It would also be nice to go
       through and replace the few remaining magic numbers with macros at some
       point in the future.
   XXX This has only been tested with the MV88E6161, but it should work with
       minimal or no modification on related switches, so support for probing
       them was included.

Thanks to Pat Saavedra of TELoIP and Rafal Jaworowski of Semihalf for their
assistance in understanding the switch chipset.