Commit Graph

74880 Commits

Author SHA1 Message Date
Pyun YongHyeon
d92c7395bf MFC r202269:
Add BCM5754 PHY id that is found on Dell Studio XPS 16.
2010-01-21 00:37:14 +00:00
Nathan Whitehorn
75a2f19f20 MFC r200018:
Bump limits on PowerPC. This allows large executables like parts of LLVM
to function.

Reviewed by:	grehan
Obtained from:	NetBSD
2010-01-20 16:28:39 +00:00
Konstantin Belousov
dc657f6117 MFC r198429, r198439, r198468, r201209, r201822, r201882:
Syncronize iwn(4) driver in stable/8 with HEAD.

Approved by:	rpaulo
2010-01-20 15:22:34 +00:00
Xin LI
b1ebb318cb MFC r201690:
Space cleanup for revision 202669 committed separately for easier review.
This commit is purely space changes.

Submitted by:	Matt Reimer
Sponsored by:	VPOP Technologies, Inc.
2010-01-20 01:14:54 +00:00
Xin LI
ac07939f0e MFC r201689:
Instead of assuming all vdevs are healthy, check the newest vdev label
for each vdev's status.  Booting from a degraded vdev should now be
more robust.

Submitted by:	Matt Reimer <mattjreimer at gmail.com>
Sponsored by:	VPOP Technologies, Inc.
2010-01-20 01:13:52 +00:00
Alexander Motin
6c35bbee61 MFC r201222:
Usually these controllers are able to automatically decode command code to
get required command protocol. But they have no idea about new commands,
such as DATA SET MANAGEMENT (TRIM). As soon as this info any way provided
by CAM, give controller specific instructions.
2010-01-19 13:36:12 +00:00
Alexander Motin
f288580266 MFC r200814:
Clear all ports interrupt status bits in single write. Clearing one by one
causes additional MSIs messages sent if several ports asked for attention
same time. Time window before clearing is not important, as these interrupts
are level triggered by interrupt source.
2010-01-19 13:33:31 +00:00
Alexander Motin
89dbf1bfd5 MFC r201993:
Report which of IXP700 legacy ATA channels are SATA.
2010-01-19 13:27:54 +00:00
Alexander Motin
4c75a1d302 MFC r200857:
Add support for Intel SCH PATA controller.

PR:             kern/140251
2010-01-19 13:26:45 +00:00
Alexander Motin
44f39e7d59 MFC r200817:
Spell AMD properly.
2010-01-19 13:25:31 +00:00
Alexander Motin
f59a7ba7ba MFC r200754:
Add VIA CX700/VX800 chipsets SATA/PATA support.

PR:             kern/121521
2010-01-19 13:24:11 +00:00
Alexander Motin
1c2e876f53 MFC r200753:
Fairly set master/slave shared PIO/WDMA timings on ITE 821x controllers.
Previous implementation could only limit mode, but not rise it back.
2010-01-19 13:21:25 +00:00
Alexander Motin
928e4114fe MFC r200655:
Serverworks OSB4 has no 0x4a (piomode) register, do not touch it.
Also OSB4 has some problems with UDMA transfers, limit it to WDMA2.
2010-01-19 13:07:25 +00:00
Alexander Motin
b136f43d44 MFC r201990:
- Report SATA in legacy emulation mode still as SATA.
- Make ATA XPT able to handle such case.
2010-01-19 13:00:33 +00:00
Alexander Motin
92d8dadcf8 MFC r201139:
Add BIO_DELETE support to ada(4):
- For SSDs use TRIM feature of DATA SET MANAGEMENT command, as defined by
ACS-2 specification working draft.
- For CompactFlash use CFA ERASE command, same as ad(4) does.

With this patch, `newfs -E /dev/ada1` was able to restore write speed of
my heavily weared OCZ Vertex SSD (firmware 1.4) up to the initial level
for the most part of it's capacity.

I have no idea whether it is normal, but for some reason it takes 200ms
to handle any TRIM command on this drive, that was making delete extremely
slow. But TRIM command is able to accept long list of LBAs and the length of
that list seems doesn't affect it's execution time. Implemented request
clusting algorithm allowed me to rise delete rate up to reasonable numbers,
when many parallel DELETE requests running.
2010-01-19 12:58:29 +00:00
Alan Cox
294a68ca62 MFC r202085
Simplify pmap_init().  Additionally, correct a harmless misbehavior on
  i386.
2010-01-18 21:17:03 +00:00
Attilio Rao
702748e988 MFC r200447,201703,201709-201710:
In current code, threads performing an interruptible sleep
will leave the waiters flag on forcing the owner to do a wakeup even
when the waiter queue is empty.
That operation may lead to a deadlock in the case of doing a fake wakeup
on the "preferred" queue while the other queue has real waiters on it,
because nobody is going to wakeup the 2nd queue waiters and they will
sleep indefinitively.
A similar bug, is present, for lockmgr in the case the waiters are
sleeping with LK_SLEEPFAIL on.

Add a sleepqueue interface which does report the actual number of waiters
on a specified queue of a waitchannel and track if at least one sleepfail
waiter is present or not. In presence of this or empty "preferred" queue,
wakeup both waiters queues.

Discussed with:	kib
Tested by:	Pete French <petefrench at ticketswitch dot com>,
		Justin Head <justin at encarnate dot com>
2010-01-18 14:43:44 +00:00
Yoshihiro Takahashi
0bd3076764 MFC: revision 201415
Re-enable more options and devices.  Now kernel size problem is gone.
2010-01-18 11:03:39 +00:00
Ed Schouten
2c9e180f34 MFC r201532:
Make TIOCSTI work again.

  It looks like I didn't implement this when I imported MPSAFE TTY.
  Applications like mail(1) still use this. I think it's conceptually bad.

  Tested by:    Pete French <petefrench ticketswitch com>
2010-01-18 09:04:53 +00:00
Xin LI
d958a7e440 MFC r202129:
Report ZFS filesystem version instead of the zpool version when we say it.

Reported by:	Yuri Pankov (on -fs@)
Submitted by:	delphij
2010-01-18 05:03:40 +00:00
Warner Losh
7578ff89fc MFC r202019:
Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms.
  # This is the resolution of removing it from DEFAULTS...
2010-01-18 00:53:21 +00:00
Rick Macklem
8c271f6707 MFC: r201442
The test for "same client" for the experimental nfs server over NFSv4
was broken w.r.t. byte range lock conflicts when it was the same client
and the request used the open_to_lock_owner4 case, since lckstp->ls_clp
was not set. This patch fixes it by using "clp" instead of "lckstp->ls_clp".
2010-01-17 20:49:34 +00:00
Rick Macklem
05cb54875e MFC: r201439
Fix three related problems in the experimental nfs client when
checking for conflicts w.r.t. byte range locks for NFSv4.
1 - Return 0 instead of EACCES when a conflict is found, for F_GETLK.
2 - Check for "same file" when checking for a conflict.
3 - Don't check for a conflict for the F_UNLCK case.
2010-01-17 20:18:59 +00:00
Andrew Thompson
e18bb09e1a Hook up uhso to the build. 2010-01-17 18:37:36 +00:00
Andrew Thompson
300db511e2 MFC r202054
Add the Globetrotter GE40x.
2010-01-17 18:36:22 +00:00
Andrew Thompson
ebd4481685 MFC r201766
Remove unneeded includes.
2010-01-17 18:33:47 +00:00
Andrew Thompson
dd079737f0 MFC r201714
Fix debug printf on 64bit arches.
2010-01-17 18:33:05 +00:00
Andrew Thompson
09a54b8e79 MFC r201701
Add new umass quirks for Western Digital MYBook and JMicron JM20337.

PR:		usb/142225, usb/142228
Submitted by:	Thomas Ward, Yoshikazu GOTO
2010-01-17 18:32:20 +00:00
Andrew Thompson
9d25e8387f MFC r201681
Improve u3g device ejecting by providing additional methods for the eject
 command in the usb_msctest routines, as well as a general tidyup.
2010-01-17 18:31:27 +00:00
Andrew Thompson
6b5b582259 MFC r201680
scratch_size was incorrectly passed as language ID when retrieving the language
 ID table, this broke string retrieval on some devices.

Submitted by:	Hans Petter Selasky
Reported by:	Renato Botelho
2010-01-17 18:30:37 +00:00
Andrew Thompson
e8f0a2d170 MFC r201318
Add new device ID to uipaq driver

PR:		usb/141936
Submitted by:	HASHI Hiroaki
2010-01-17 18:29:30 +00:00
Andrew Thompson
bc4acc704f MFC r202181,202243,202270
Add a driver by Fredrik Lindberg for Option HSDPA USB devices. These differ
 from standard 3G wireless units by supplying a raw IP/IPv6 endpoint rather than
 using PPP over serial. uhsoctl(1) is used to initiate and close the WAN
 connection.

Obtained from:	Fredrik Lindberg <fli@shapeshifter.se>
2010-01-17 18:22:42 +00:00
Michael Tuexen
06ee5047d5 MFC 201523
Correct usage of parenthesis.
2010-01-17 18:18:01 +00:00
Michael Tuexen
45bde0da39 MFC 199459
Get rid of unused fields addr_over which is never really used,
only copied around.
2010-01-17 17:49:28 +00:00
Michael Tuexen
64224569da MFC 199374
Fix a bug where queued ASCONF messags are not sent out.
From Irene Ruengeler.
2010-01-17 17:46:48 +00:00
Michael Tuexen
533e1ca310 MFC 198621
Improve round robin stream scheduler and cleanup some code.
2010-01-17 17:45:09 +00:00
Michael Tuexen
53b14b7294 MFC 197341
Fix errnos.
2010-01-17 17:41:43 +00:00
Michael Tuexen
fb7bf5f374 MFC 198499
Improve the round robin stream scheduler.
2010-01-17 17:10:17 +00:00
Michael Tuexen
33dabcc064 MFC 199437
Use always LIST_EMPTY instead of sometime SCTP_LIST_EMPTY,
which is defined as LIST_EMPTY.
2010-01-17 17:05:59 +00:00
Michael Tuexen
24a263d9da MFC 199372
Do not start the iterator when there are no associations.
This fixes a bug found by Irene Ruengeler.
2010-01-17 17:03:40 +00:00
Michael Tuexen
801fc2d035 MFC 199369
Do not hold the lock longer than necessary.
2010-01-17 17:01:01 +00:00
Michael Tuexen
a8725a275a MFC 198522:
Bugfix: Use formula from section 7.2.3 of RFC 4960. Reported by Martin Becke.
2010-01-17 16:58:37 +00:00
Bjoern A. Zeeb
66cbfdf290 MFC r202116:
Adjust a comment to reflect reality, as we have proper source
  address selection, even for IPv4, since r183571.

  Pointed out by:	Jase Thew (bazerka beardz.net)
2010-01-17 13:42:07 +00:00
Bjoern A. Zeeb
cd10550438 MFC r201995:
Correct a typo.
2010-01-17 13:38:11 +00:00
Bjoern A. Zeeb
8f335c80b5 MFC r201898:
Add comments trying to explain what bad things happen here, i.e.
  how hashed MD5/SHA are implemented, abusing Final() for padding and
  sw_octx to transport the key from the beginning to the end.

  Enlightened about what was going on here by: cperciva
  Reviewed by:  cperciva
2010-01-17 13:36:13 +00:00
Bjoern A. Zeeb
71902ae69a MFC r201742:
After adding an SDT provider for opencrypto in r199884 we should also
  depend on opt_kdtrace.h for the module build.

  Submitted by: (Andre.Albsmeier siemens.com)
2010-01-17 13:28:06 +00:00
Bjoern A. Zeeb
06f8631988 MFC r201688:
Correct a typo.

  Submitted by: sn_ (sn_ gmx.net) on hackers@
2010-01-17 13:23:53 +00:00
Mitsuru IWASAKI
d077836245 MFC r201605: Update acpi_ibm syctl nodes on resume. 2010-01-17 06:24:09 +00:00
Marius Strobl
08fe729d97 MFC: r201899
Some style(9) fixes
2010-01-16 12:18:44 +00:00
Marius Strobl
964863ced5 MFC: r201896
As nfsm_srvmtofh_xx() assumes the 4-byte alignment required by XDR
ensure the mbuf data is aligned accordingly by calling nfs_realign()
in fha_extract_info(). This fix is orthogonal to the problem solved
by r199274/r199284 (MFC'ed to stable/8 in r199733).

PR:		142102 (second part)
2010-01-16 12:16:38 +00:00
Alexander Motin
ea0c5a5936 Partially revert r202428. There is no bus_describe_intr() on RELENG_8. 2010-01-16 07:55:46 +00:00
Marcel Moolenaar
fdc6e8a301 MFC rev 201941:
Remove file system support based on the simple file system protocol.

MFC rev 201966:
Remove debugging printf().
2010-01-16 04:34:03 +00:00
Alexander Motin
392777822f MFC r202011:
While AHCI specification tells that multi-vector MSI doesn't use global IS
register, nVidia chipsets have different oppinion, requiring every interrupt
to be acknowledged there.

While there, add interrupt descriptions in multi-vector MSI mode.
2010-01-15 23:58:37 +00:00
Alexander Motin
8e7a844b9b MFC r201645:
Change the way in which zero stripesize is handled. Instead of reporting
zero stripeoffset in such case (as if device has no stripes), report offset
from the beginning of the media (as if device has single infinite stripe).

This gives partitioning tools information, required to guess better
partition alignment, in case if hardware doesn't report it's stripe size.
For example, it should give disklabel info about odd offset made by fdisk.
2010-01-15 23:56:19 +00:00
Konstantin Belousov
217f185c22 MFC r201890:
Set md_ldt after md_ldt_sd is populated.
2010-01-15 22:19:51 +00:00
Marius Strobl
72021af065 MFC: r201052, r201200, r202003, r202010, r202023
Add a driver for the `Fire' JBus to PCIe bridges found in at least
the Sun Fire V215/V245 and Sun Ultra 25/45 machines. This driver also
already includes all the code to support the `Oberon' Uranus to PCIe
bridges found in the Fujitsu-Siemens based Mx000 machines but due to
lack of access to such a system for testing, probing of these bridges
is currently disabled.
Unfortunately, the event queue mechanism of these bridges for MSIs/
MSI-Xs matches our current MD and MI interrupt frameworks like square
pegs fit into round holes so for now we are generous and use one event
queue per MSI, which limits us to 35 MSIs/MSI-Xs per Host-PCIe-bridge
(we use one event queue for the PCIe error messages). This seems
tolerable as long as most devices just use one MSI/MSI-X anyway.
Adding knowledge about MSIs/MSI-Xs to the MD interrupt code should
allow us to decouple the 1:1 mapping at the cost of no longer being
able to bind MSIs/MSI-Xs to specific CPUs as we currently have no
reliable way to quiesce a device during the transition of its MSIs/
MSI-Xs to another event queue. This would still require the problem
of interrupt storms generated by devices which have no one-shot
behavior or can't/don't mask interrupts while the filter/handler is
executed (like the older PCIe NICs supported by bge(4)) to be solved
though.
2010-01-15 21:45:46 +00:00
Marius Strobl
8e52edcf3b MFC: r202006
Add epic(4), a driver for the front panel LEDs in Sun Fire V215/V245.
It's named after the driver doing the same job in OpenSolaris.
2010-01-15 19:12:33 +00:00
Marius Strobl
455564ab5c MFC: r201932
- Add code allowing a network device to only be open and closed once
  by keeping it opened after the first open and closing it via the
  cleanup handler when NETIF_OPEN_CLOSE_ONCE is defined in order to
  avoid the open-close-dance on every file access which with firmware
  that for example performs an auto-negotiation on every open causes
  netbooting to take horribly long. Basically the behavior with this
  knob enabled resembles the one employed between r60506 and r177108
  (and for sparc64 also again since r182919) with the addition that
  the network device now is closed eventually before entering the
  kernel and before rebooting. Actually I think this should be the
  desired MI behavior, however the U-Boot loader actually requires
  net_close() to be called after every transaction in order for some
  local shutdown operations to be performed (and which I think thus
  will break on concurrent opens, i.e. when netdev_opens is > 1, like
  the loader does at least for disks when LOADER_GZIP_SUPPORT is
  enabled).
- Use NETIF_OPEN_CLOSE_ONCE to replace the hack, which artificially
  increased netdev_opens for sparc64 in order to keep the network
  device opened forever, as at least some firmware versions require
  the network device to be closed eventually before entering the
  kernel or otherwise will DMA received packets to stale memory.
  The powerpc OFW loader probably wants NETIF_OPEN_CLOSE_ONCE to be
  set as well for the same reasons.
2010-01-15 19:06:33 +00:00
Marius Strobl
1a6cae7f37 MFC: r201901
Remove clause 3 and 4 from TNF licenses (this was the only 4-clause TNF
license FreeBSD had in sys/boot).

Obtained from:	NetBSD
2010-01-15 16:57:49 +00:00
Marius Strobl
39759286df MFC: r201396, r201410
- Demapping unused kernel TLB slots has proven to work reliably so move
  the associated debugging under bootverbose.
- Remove freebsd4_sigreturn(); given that FreeBSD 4 didn't supported
  sparc64 this only ever served as a transition aid prior to FreeBSD
  5.0 and is unused by default since COMPAT_FREEBSD4 was removed from
  GENERIC in r143072 nearly 5 years ago.
2010-01-15 16:54:59 +00:00
Marius Strobl
bfb0b715ce MFC: r201395
- Preserve the PROM IOMMU in order to allow OFW drivers to continue to
  work.
- Sanity check the parameters passed to the implementations of the
  pcib_{read,write}_config() methods. Using illegal values can cause
  no real harm but it doesn't hurt to avoid unnecessary data error
  traps requiring to flush and re-enable the level 1 caches.
2010-01-15 16:46:03 +00:00
Marius Strobl
98fb63cac1 MFC: r201199
- Prefer i and j over i and n for temporary integer variables.
- Wrap/shorten too long lines.
- Remove a redundant variable and an unnecessary cast in schizo(4).
2010-01-15 16:42:39 +00:00
Marius Strobl
5896e2fa27 MFC: r201009
Remove clause 3 from Izumi Tsutsui's licenses.

Obtained from:	NetBSD
2010-01-15 16:29:40 +00:00
Marius Strobl
b70d493910 MFC: r201008
Style changes

Obtained from:	NetBSD (mc146818reg.h)
2010-01-15 16:27:57 +00:00
Marius Strobl
2a2cbae7cb MFC: r201005, r201371
- Take advantage of bus_{read,write}_*(9).
- Set dow = -1 in mk48txx_gettime() because some drivers (for example
  the NetBSD and OpenBSD mk48txx(4)) don't set it correctly.
2010-01-15 15:47:31 +00:00
Marius Strobl
1051ec0b8a MFC: r201004
Remove clause 3 and 4 from TNF licenses.

Obtained from:	NetBSD
2010-01-15 15:42:14 +00:00
Marius Strobl
3425abf549 MFC: r201003
Style changes
2010-01-15 15:40:44 +00:00
Marius Strobl
435ada6626 - Hook up the default implementations of the MSI/MSI-X pcib_if methods
so requests may bubble up to a host-PCI bridge driver.
- Distinguish between PCI and PCIe bridges in the device description
  so it's a bit easier to follow what hangs off of what in the dmesg.
  Unfortunately we can't also tell PCI and PCI-X apart based on the
  information provided in the OFW device tree.
- Add quirk handling for the ALi M5249 found in Fire-based machines
  which are used as a PCIe-PCIe bridge there. These are obviously
  subtractive decoding as as they have a PCI-ISA bridge on their
  secondary side (and likewise don't include the ISA I/O range in
  their bridge decode) but don't indicate this via the class code.
  Given that this quirk isn't likely to apply to all ALi M5249 and
  I have no datasheet for these chips so I could implement a check
  using the chip specific bits enabling subtractive decoding this
  quirk handling is added to the MD code rather than the MI one.
2010-01-15 15:38:49 +00:00
Marius Strobl
9d65a8f834 MFC: r200947
Add missing locking in intr_bind().
2010-01-15 15:36:12 +00:00
Marius Strobl
95915f9fa6 MFC: r200946
Execute the cleanup handlers before jumping to the kernel just
like the other architectures do.
2010-01-15 15:28:57 +00:00
Marius Strobl
e6af3b7bb8 MFC: r200945
- Consistently wrap debugging in NETIF_DEBUG. This basically merges
  NetBSD rev 1.19.
- Make the functions match their prototypes regarding static.
2010-01-15 15:27:17 +00:00
Yoshihiro Takahashi
b304370214 MFC: revision 201342
Reimplement the boot2 for pc98 completely.
  It's based on the newest i386's one and has the advantage of:

   - ELF binary support.
   - UFS2 filesystem support.
   - Many FreeBSD slices support on a disk.
2010-01-15 12:27:46 +00:00
Marius Strobl
854f8af819 MFC: r200944
Revert r183628 as with the current ata(4) ATAPI DMA with AcerLabs
M5229 appears to be once again fixed. If this happens to return
we probably should disable ATAPI DMA in ataacerlabs(4) instead
just like the Linux libATA does.
2010-01-15 12:07:30 +00:00
Yoshihiro Takahashi
cf83985263 MFC: revision 201339 and 201340
- Add setting machine type support to the loader.
  - Don't use 15M-16M area on pc98.  It's reserved for some devices.
2010-01-15 11:26:20 +00:00
Pyun YongHyeon
073ffa6670 MFC r201769:
Enable ste(4). ste(4) should work on all architectures.
2010-01-14 22:36:06 +00:00
Pyun YongHyeon
6b15d2af78 MFC r200950,200955,200965-200966,201767-201768
r200950:
  Implement RX interrupt moderation using one-shot timer interrupt.
  Unlike TX interrupt, ST201 does not provide any mechanism to
  suppress RX interrupts. ste(4) can generate more than 70k RX
  interrupts under heavy RX traffics such that these excessive
  interrupts make system useless to process other useful things.
  Maybe this was the major reason why polling support code was
  introduced to ste(4).
  The STE_COUNTDOWN register provides a programmable counter that
  will generate an interrupt upon its expiration. We program
  STE_DMACTL register to use 3.2us clock rate to drive the counter
  register. Whenever ste(4) serves RX interrupt, the driver rearm
  the timer to expire after STE_IM_RX_TIMER_DEFAULT time and disables
  further generation of RX interrupts. This trick seems to work well
  and ste(4) generates less than 8k RX interrupts even under 64 bytes
  UDP torture test. Combined with TX interrupts, the total number of
  interrupts are less than 10k which looks reasonable on heavily
  loaded controller.

  The default RX interrupt moderation time is 150us. Users can change
  the value at any time with dev.ste.%d.int_rx_mod sysctl node.
  Setting it 0 effectively disables the RX interrupt moderation
  feature. Now we have both TX/RX interrupt moderation code so remove
  loop of interrupt handler which resulted in sub-optimal performance
  as well as more register accesses.

r200955:
  Add suspend/resume support as well as basic WOL.
  While I'm here simplify SIOCSIFCAP handler.

r200965:
  Update if_iqdrops in case of RX buffer allocation failure.

r200966:
  ether_ifattach sets if_mtu, remove unnecessary code.

r201767:
  Fix EEPROM access code to return data in host byte order.
  EEPROM on ST201 always returns 16bits data with little endian
  format so conversion to host order is required.
  This change fixes inversed ethernet address on sparc64.

r201768:
  Make sure to store dma address of RX buffer in little endian form.
  This fixes the last bug which keeps ste(4) from working on sparc64.
2010-01-14 22:26:52 +00:00
Pyun YongHyeon
812b4b875d MFC r200904-200908,200910-200913
r200904:
  Don't reinitialize controller if driver is already running. This
  reduces number of link state UP/DOWN changes.

r200905:
  Reimplement controller reset. Datasheet says full reset takes about
  1ms. Since we switched to memory register mapping make sure to
  flush PCI posted write by reading the register again.
  While I'm here add additional delays in loop while driver waits the
  completion of the reset.

r200906:
  Overhaul RX filter programming.
   o Let RX filter handler program promiscuous/multicast filter as
     well as broadcasting.
   o Remove unnecessary register access.
   o Simplify ioctl handler and have set_rxfilter to handle
     IFF_PROMISC and IFF_ALLMULTI change instead of directly
     programming the controller.
   o Removed unnecessary error variable reinitialization in ioctl
     handler.
   o Add IFF_DRV_RUNNING check before programming multicast filter.
   o Configure maximum allowed frame length before enabling MAC.
     Datasheet didn't say the exact ordering of programming sequence
     but it looks more natural to set maximum allowed frame length
     first prior to enabling controller.

r200907:
  Don't report link status if driver is not running.

r200908:
  Report the correct result of mii_mediachg(). Previously it always
  used to return success without respect to the result.
  While I'm here use mii_mediachg() in ste_init_locked which allows
  driver to use currently configured media. ste_ifmedia_upd() is
  supposed to be called whenever user changes current media settings.

r200910:
  Implement hardware MAC statistics counter support. The counters
  could be accessed with dev.ste.0.stats sysctl node.

r200911:
  Remove unused duplicated register definition. It seems the
  definition was made to access STE_ASICCTL register as 16bits but
  ste(4) always access the register as 32bits so it was never used
  before.

r200912:
  Correct STE_COUNTDOWN register offset. The datasheet was wrong.

r200913:
  We don't need to generate DMA complete interrupt for every
  transmitted frames. So request interrupt for every 16th frames. Due
  to the limitation of hardware we can't suppress the interrupt as
  driver should have to check TX status register. The TX status
  register can store up to 31 TX status so driver can't send more
  than 31 frames without reading TX status register.
  With this change controller would not generate TX completion
  interrupt for every frame, so reclaim transmitted frames in
  ste_tick().
2010-01-14 22:15:51 +00:00
Pyun YongHyeon
0d9ae5891e MFC r200854,200856,200865,200873,200875,200877,200884
r200854:
  Add minimal dealy while ste(4) is waiting for the end of active DMA
  cycle.

r200856:
  Introduce sc_flags member variable and use it to keep track of
  link state and PHY related information.
  Remove ste_link and ste_one_phy variable of softc as it's not used
  anymore.
  While I'm here add IFF_DRV_RUNNING check in ste_start_locked().

r200865:
  Reimplement miibus_statchg method. Don't rely on link state change
  interrupt. If we want to use link state change interrupt ste(4)
  should also implement auto-negotiation complete handler as well as
  various PHY access handling. Now link state change is handled by
  mii(4) polling so it will automatically update link state UP/DOWN
  events which in turn make ste(4) usable with lagg(4).

  r199559 added a private timer to drive watchdog and the timer also
  used to drive MAC statistics update. Because the MAC statistics
  update is called whenever statistics counter reaches near-full, it
  drove watchdog timer too fast such that it caused false watchdog
  timeouts under heavy TX traffic conditions.
  Fix the regression by separating ste_stats_update() from driving
  watchdog timer and introduce a new function ste_tick() that handles
  periodic job such as driving watchdog, MAC statistics update and
  link state check etc.
  While I'm here clear armed watchdog timer in ste_stop().

r200873:
  Instead of relying on hard resetting of controller to stop
  receiving incoming traffics, try harder to gracefully stop active
  DMA cycles and then stop MACs. This is the way what datasheet
  recommends and seems to work reliably. Resetting controller while
  active DMAs are in progress is bad thing as we can't predict how
  DMAs touche allocated TX/RX buffers. This change ensures controller
  stop state before attempting to release allocated TX/RX buffers.
  Also update MAC statistics which could have been updated during the
  wait time of MAC stop.

  While I'm here remove unnecessary controller resets in various
  location. ste(4) no longer relies on hard controller reset to stop
  controller and resetting controller also clears all configured
  settings which makes it hard to implement WOL in near future.
  Now resetting a controller is performed in ste_init_locked().

r200875:
  Prefer memory space register mapping over io space. If memory space
  mapping fails fall back to old io space mapping.
  While I'm here use PCIR_BAR macro.

r200877:
  Prefer bus_write_{1,2,4}/bus_read_{1,2,4} to
  bus_space_write_{1,2,4}/bus_space_read_{1,2,4}.
  Remove unused ste_bhandle and ste_btag in softc.

r200884:
  Reimplement Tx status error handler as recommended by datasheet.
  If ste(4) encounter TX underrun or excessive collisions the TX MAC
  of controller is stalled so driver should wake it up again. TX
  underrun requires increasing TX threshold value to minimize
  further TX underruns. Previously ste(4) used to reset controller
  to recover from TX underrun, excessive collision and reclaiming
  error. However datasheet says only TX underrun requires resetting
  entire controller. So implement ste_restart_tx() that restarts TX
  MAC and do not perform full reset except TX underrun case.
  Now ste(4) uses CSR_READ_2 instead of CSR_READ_1 to read
  STE_TX_STATUS register. This way ste(4) will also read frame id
  value and we can write the same value back to STE_TX_FRAMEID
  register instead of overwriting it to 0. The datasheet was wrong
  in write back of STE_TX_STATUS so add some comments why we do so.
  Also always invoke ste_txeoc() after ste_txeof() in ste_poll as
  without reading TX status register can stall TX MAC.
2010-01-14 22:00:33 +00:00
Pyun YongHyeon
0f9ecfd9cc MFC r200853:
Add bus_dma(9) and endianness support to ste(4).
   o Sorted includes and added missing header files.
   o Added basic endianness support. In theory ste(4) should work on
     any architectures.
   o Remove the use of contigmalloc(9), contigfree(9) and vtophys(9).
   o Added 8 byte alignment limitation of TX/RX descriptor.
   o Added 1 byte alignment requirement for TX/RX buffers.
   o ste(4) controllers does not support DAC. Limit DMA address space
     to be within 32bit address.
   o Added spare DMA map to gracefully recover from DMA map failure.
   o Removed dead code for checking STE_RXSTAT_DMADONE bit. The bit
     was already checked in each iteration of loop so it can't be true.
   o Added second argument count to ste_rxeof(). It is used to limit
     number of iterations done in RX handler. ATM polling is the only
     consumer.
   o Removed ste_rxeoc() which was added to address RX stuck issue
     (cvs rev 1.66). Unlike TX descriptors, ST201 supports chaining
     descriptors to form a ring for RX descriptors. If RX descriptor
     chaining is not supported it's possible for controller to stop
     receiving incoming frames once controller pass the end of RX
     descriptor which in turn requires driver post new RX
     descriptors to receive more frames. For TX descriptors which
     does not support chaning, we exactly do manual chaining in
     driver by concatenating new descriptors to the end of previous
     TX chain.
     Maybe the workaround was borrowed from other drivers that does
     not support RX descriptor chaining, which is not valid for ST201
     controllers. I still have no idea how this address RX stuck
     issue and I can't reproduce the RX stuck issue on DFE-550TX
     controller.
   o Removed hw.ste_rxsyncs sysctl as the workaround was removed.
   o TX/RX side bus_dmamap_load_mbuf_sg(9) support.
   o Reimplemented optimized ste_encap().
   o Simplified TX logic of ste_start_locked().
   o Added comments for TFD/RFD requirements.
   o Increased number of RX descriptors to 128 from 64. 128 gave much
     better performance than 64 under high network loads.
2010-01-14 21:45:39 +00:00
Andrew Gallatin
1d2d3276c2 MFC: r202120:
Update mxge(4) firmware to 1.4.48b (latest available) from Myricom.
2010-01-14 21:30:06 +00:00
Andrew Gallatin
ed0e6c2a44 MFC r202121:
Use better default RSS hash (src + dst, rather than just src port)
2010-01-14 21:10:36 +00:00
Andrew Gallatin
3070a40c8a MFC 202119: Fix reporting of 10G Twinax media 2010-01-14 20:59:02 +00:00
Pyun YongHyeon
41c95608a0 MFC r200798,200801,200803-200804,200808,200810
r200798:
  Use ANSI function definations.

r200801:
   o Remove unnecessary return statement.
   o Remove register keyword.

r200803:
  s/u_intXX_t/uintXX_t/g

r200804:
  Remove trailing white spaces.

r200808:
  style(9)

r200810:
  Sort function prototyes.
2010-01-14 20:47:49 +00:00
Pyun YongHyeon
699df0c4fa Partial merge r199559:
- Add a private timer to drive the transmit watchdog instead of using
    if_watchdog and if_timer.
  - Fix some issues in detach for sn(4), ste(4), and ti(4).  Primarily this
    means calling ether_ifdetach() before anything else.
2010-01-14 20:38:40 +00:00
Rick Macklem
ea6ffaa742 MFC: r201345
Fix the experimental NFS client so that it can create Unix
domain sockets on an NFSv4 mount point. It was generating
incorrect XDR in the request for this case.

Tested by:	infofarmer
2010-01-14 17:35:07 +00:00
Marius Strobl
d07d09d79f MFC: r200938
- Don't check for a valid interrupt controller on every interrupt
  in intr_execute_handlers(). If we managed to get here without an
  associated interrupt controller we have way bigger problems.
  While at it predict stray vector interrupts as false as they are
  rather unlikely.
- Don't blindly call the clear function of an interrupt controller
  when adding a handler in inthand_add() as interrupt controllers
  like the one driven by upa(4) are auto-clearing and thus provide
  NULL instead.
2010-01-13 21:23:27 +00:00
Marius Strobl
74794d0d58 MFC: r200926
Recognize the NS16552 found in PCIe-based sun4u machines.
2010-01-13 21:21:29 +00:00
Marius Strobl
1f0040f79f MFC: r200925
- By re-arranging the code in OF_decode_addr() somewhat and accepting
  a bit of a detour we can just iterate through the banks array instead
  of having to calculate every offset. This change is inspired by the
  powerpc version of this function.
- Add support for the JBus to EBus bridges which hang off of nexus(4).
2010-01-13 21:19:46 +00:00
Marius Strobl
f07dd8aaa5 MFC: r200924
Style changes.
2010-01-13 21:17:45 +00:00
Marius Strobl
b740c16a21 MFC: r200923
- Add support for the IOMMUs of Fire JBus to PCIe and Oberon Uranus
  to PCIe bridges.
- Add support for talking the PROM mappings over to the kernel IOTSB
  just like we do with the kernel TSB in order to allow OFW drivers
  to continue to work.
- Change some members, parameters and variables to unsigned where
  more appropriate.
2010-01-13 21:16:07 +00:00
Marius Strobl
c05db9b041 MFC: r200922
Fix whitespace according to style(9).
2010-01-13 21:13:50 +00:00
Marius Strobl
bdb2fdd6af MFC: r200921
- Add quirk handling for ALi M5229, mainly setting the magic "force
  enable IDE I/O" bit which prevents data access traps with revision
  0xc8 in Fire-based machines when pci(4) enables PCIM_CMD_PORTEN.
- Like for sun4v also don't add the PCI side of host-PCIe bridges to
  the bus on sun4u as they don't have configuration space implement
  there either.
2010-01-13 21:12:27 +00:00
Marius Strobl
8677820407 MFC: r200920
- Sort the prototypes.
- Add macros to ease the access of device configuration space in
  ofw_pcibus_setup_device().
2010-01-13 21:08:57 +00:00
Marius Strobl
778251c8a4 MFC: r200918
Add structures for OFW MSI/MSI-X support. These are identical for
both sun4u and sun4v.
2010-01-13 21:04:56 +00:00
Marius Strobl
f168880574 MFC: r200917
Hook ebus(4) and isa(4) up to the sun4v LINT build in order to
ensure that their compilation doesn't break as they are expected
to work as-is now (but aren't actually run-time tested).
2010-01-13 21:03:04 +00:00
Marius Strobl
7d0ba636c6 MFC: r200916
Remove devices which are/were only relevant for sun4u.
2010-01-13 20:59:36 +00:00
Marius Strobl
4cb21bdfca MFC: r200915
Don't probe the bq4802 variant found in Ultra 25 and 45 for now as
this chip isn't MC146818 compatible and requires different handlers
(but which I can't test due to lack of such hardware).
2010-01-13 20:51:21 +00:00
Marius Strobl
f71a779bb7 MFC: r200914
Don't use an out register to hold the vector number across the call
of the interrupt handler in intr_fast() as the handler might clobber
it (no in-tree handler currently does but an upcoming one will).
While at it, tidy the register usage in the interrupt counting code.
2010-01-13 20:40:49 +00:00
Marius Strobl
96642ec4ae MFC: r200880
- Correct an off-by-one error when calculating the end of a child
  range.
- Spell the PCI TLA in uppercase.
2010-01-13 20:35:27 +00:00
Marius Strobl
990824aa76 MFC: r200879
- Add support for the JBus to EBus bridges which hang off of nexus(4)
  and are found in sun4u and sun4v machines based on the Fire ASIC.
- Initialize the configuration space of the PCI to EBus variant the
  same way as OpenSolaris does.
2010-01-13 20:32:54 +00:00
Marius Strobl
4acf9b4548 MFC: r200878
- Add macros for the states of the interrupt clear registers.
- Change INTMAP_VEC() to take an INO as its second argument rather
  than an INR. The former is what I actually intended with this
  macro and how it's currently used.
2010-01-13 20:07:45 +00:00
Marius Strobl
b61d79e43e MFC: r200876
Make these constants unsigned which is more appropriate.
2010-01-13 20:05:32 +00:00
Marius Strobl
cd93dd27dd MFC: r200874
Enroll these drivers in multipass probing. The motivation behind this
is that the JBus to EBus bridges share the interrupt controller of a
sibling JBus to PCIe bridge (at least as far as the OFW device tree
is concerned, in reality they are part of the same chip) so we have to
probe and attach the latter first. That happens to be also the case
due to the fact that the JBus to PCIe bridges appear first in the OFW
device tree but it doesn't hurt to ensure the right order.
2010-01-13 20:03:24 +00:00
Marius Strobl
d9d6b39c57 MFC: r200815, r200816
Provide and consume missing module dependency information.
2010-01-13 19:59:13 +00:00
Marius Strobl
955990d26e MFC: 197164
Factor out the duplicated macro for the device type used in the
OFW device tree for PCI bridges and add a new one for PCI Express.
While at it, take advantage of the former for the rman(9) work-
around in jbusppm(4).
2010-01-13 19:55:51 +00:00
Brooks Davis
2a46409df5 MFC r201955:
Improve the comment about CMGROUP_MAX.
2010-01-12 06:14:24 +00:00
Brooks Davis
43ede8f5fe MFC r201954:
Update the comment on printing group membership to reflect that fact
  that each group the process is a member of is printed rather than
  an entry for each group the user could be a member of.
2010-01-12 06:11:36 +00:00
Brooks Davis
0e003a57ce MFC r201953:
Correct the explination text for the kern.ngroups.  It reflects the
  number of supplemental groups, not the total number of groups.
2010-01-12 06:09:56 +00:00
Brooks Davis
9600c47d52 MFC r201443:
Add vlan(4) to all GENERIC kernels.
2010-01-12 06:00:56 +00:00
Qing Li
4cc5ccf399 MFC r201544
An existing incomplete ARP entry would expire a subsequent
statically configured entry of the same host. This bug was
due to the expiration timer was not cancelled when installing
the static entry. Since there exist a potential race condition
with respect to timer cancellation, simply check for the
LLE_STATIC bit inside the expiration function instead of
cancelling the active timer.
2010-01-12 00:04:13 +00:00
Andrew Gallatin
a5905446f8 Sync mxge(4) with head:
r197391: Add support for TX throttling
r198250: Move mxge(4)'s NIC watchdog reset handler from
	 a callout to a taskqueue
r198303: Make mxge do a better job recovering from NIC h/w faults
r200845: Don't take the driver mutex in mxge_tick()
r201758: Remove extraneous semicolons
2010-01-11 20:32:51 +00:00
Rick Macklem
6049e7fcf7 MFC: r201029
When porting the experimental nfs subsystem to the FreeBSD8 krpc,
I added 3 functions that were already in the experimental client
under different names. This patch deletes the functions in the
experimental client and renames the calls to use the other set.
(This is just removal of duplicated code and does not fix any bug.)
2010-01-11 19:30:23 +00:00
Konstantin Belousov
2d63cbda24 MFC r200770:
Remove VI_OBJDIRTY and make sure that OBJ_MIGHTBEDIRTY is set only for
vnode-backed vm objects.
2010-01-11 12:35:16 +00:00
Ruslan Ermilov
60ee8f1ae1 MFC: r200026,201801: Swap carp(4) log levels. 2010-01-11 12:32:06 +00:00
Xin LI
0801667fe3 MFC r201143:
Apply OpenSolaris revision 8021:b8fe9660eb2d which brings our zpool
to version 14, making it possible for zpools created on OpenSolaris
2009.06 be used on FreeBSD.

PR:		kern/141800
Submitted by:	mm
Reviewed by:	pjd, trasz
Obtained from:	OpenSolaris onnv-gate
2010-01-11 02:31:00 +00:00
Marcel Moolenaar
1bb65f7e64 MFC rev 201269, 201373:
o   Revamp bus_space access functions (201269).
o   Change BUS_SPACE_MAXADDR from 2^32-1 to 2^64-1 (201373).
2010-01-10 23:51:02 +00:00
Fabien Thomas
40095a24ed MFC 201151:
Use VFS_{LOCK,UNLOCK}_GIANT() around the call to vrele().
2010-01-10 16:08:14 +00:00
Fabien Thomas
a267011a08 MFC 201023:
* Support the L1D_CACHE_LD event on Core2 processors.
 * Correct a group of typos: for Core2 programmable events, check
   user supplied umask values against the correct event descriptor
   field.
2010-01-10 16:04:32 +00:00
Fabien Thomas
cd56dc4253 MFC 201021:
Log process mappings for existing processes at PMC start time.
2010-01-10 16:00:00 +00:00
Xin LI
f0c3103b9a MFC r201756:
Re-apply onnv-gate revisions 7994 and 8986 (corresponds to FreeBSD
revision 200726 and 200727).

Reviewed by:  mm@
2010-01-10 07:08:11 +00:00
Pyun YongHyeon
b7cf4e03b6 MFC r200693:
Make sure to enable Next Page bit for IP1001. Otherwise the PHY
  fails to re-establishe 1000baseT link after downgrading to
  10/100Mbps link.
2010-01-09 01:17:31 +00:00
Pyun YongHyeon
50a44b8b9b MFC r200696,200740,200756,200758-200759,200972
r200696:
  Add rudimentary WOL support. While I'm here remove enabling
  busmastering/memory address in resume path. Bus driver will handle
  that.

r200740:
  Swap VGE_TXQTIMER and VGE_RXQTIMER register definition. Pending
  timer for Tx queue is at 0x3E.

r200756:
  Correct fragment bit definition in comments.

r200758:
  VT6130 datasheet was wrong. If VT6130 receive a jumbo frame the
  controller will split the jumbo frame into multiple RX buffers.
  However it seems the hardware always dma the frame to 8 bytes
  boundary for the split frames. Only the first part of the fragment
  can have 4 byte alignment and subsequent buffers should be 8 bytes
  aligned. Change RX buffer the alignment requirement to 8 bytes from
  4 bytes.

r200759:
  Disable jumbo frame support for PCIe VT6130/VT6132 controllers.
  Quite contrary to VT6130 datasheet which says it supports up to 8K
  jumbo frame, VT6130 does not seem to send jumbo frame that is
  larger than 4K in length. Trying to send a frame that is larger
  than 4K cause TX MAC hang.
  Even though it's possible to allow 4K jumbo frame for VT6130, I
  think it's meaningless to allow 4K jumbo frame. I'm not sure VT6132
  also has the same limitation but I guess it uses the same MAC of
  VT6130.

r200972:
  Remove wrong assertion.
2010-01-09 00:26:57 +00:00
Pyun YongHyeon
6f311c8682 MFC r200638:
Implement interrupt moderation scheme supported by VT61xx
  controllers. TX/RX interrupt mitigation is controlled by
  VGE_TXSUPPTHR and VGE_RXSUPPTHR register. These registers suppress
  generation of interrupts until the programmed frames counter equals
  to the registers. VT61xx also supports interrupt hold off timer
  register. If this interrupt hold off timer is active all interrupts
  would be disabled until the timer reaches to 0. The timer value is
  reloaded whenever VGE_ISR register written. The timer resolution is
  about 20us.

  Previously vge(4) used single shot timer to reduce Tx completion
  interrupts. This required VGE_CRS1 register access in Tx
  start/completion handler to rearm new timeout value and it did not
  show satisfactory result(more than 50k interrupts under load). Rx
  interrupts was not moderated at all such that vge(4) used to
  generate too many interrupts which in turn made polling(4) better
  approach under high network load.

  This change activates all interrupt moderation mechanism and
  initial values were tuned to generate interrupt less than 8k per
  second. That number of interrupts wouldn't add additional packet
  latencies compared to polling(4). These interrupt parameters could
  be changed with sysctl.
  dev.vge.%d.int_holdoff
  dev.vge.%d.rx_coal_pkt
  dev.vge.%d.tx_coal_pkt
  Interface has be brought down and up again before change take
  effect.

  With interrupt moderation there is no more need to loop in
  interrupt handler. This loop always added one more register access.
  While I'm here remove dead code which tried to implement subset of
  interrupt moderation.
2010-01-09 00:17:43 +00:00
Pyun YongHyeon
babaf83d9a MFC r200616-200617,200635,200639,200644
r200616:
  Add new flag VGE_FLAG_SUSPENDED to mark suspended state and
  remove suspended member in softc.

r200617:
  Add "Velocity" to probe message which will make it clearer which
  ethernet controller was recognized. VIA consistently calls
  "Velocity" family for gigabit ethernet controllers. For fast
  ethernet controllers they uses "Rhine" family(vr(4) controllers))
  and vr(4) already shows "Rhine" in probe message.

r200635:
  Remove unused VGE_ETHER_ALIGN definition.

r200639:
  Actually clear interrupts. Writing 0 has no effect.

r200644:
  Remove unused member variable of softc.
2010-01-09 00:12:59 +00:00
Pyun YongHyeon
2e04b85932 MFC 200615:
Add hardware MAC statistics support. This statistics could be
  extracted from dev.vge.%d.stats sysctl node.
2010-01-09 00:07:03 +00:00
Pyun YongHyeon
b907792655 MFC r200551-200552,200555,200558,200609,200613
r200551:
  Whenever link state change interrupt is raised, vge_tick() is
  called and vge(4) used to drive auto-negotiation timer(mii_tick) in
  vge_tick(). Therefore the mii_tick was not called for every hz such
  that auto-negotiation complete was never handled in vge(4).
  Use mii_pollstat to extract current negotiated speed/duplex instead
  of mii_tick. The latter is valid only for auto-negotiation case.
  While I'm here change the confusing function name vge_tick() to
  vge_link_statchg().

r200552:
  Report media change result to caller instead of returning success
  without regard to the result.

r200555:
  Don't report current link status if interface is not UP.
  If interface is not UP, the current link status wouldn't
  reflect the negotiated status.

r200558:
  Tell upper layer vge(4) supports long frames. This should be done
  after ether_ifattach(), as ether_ifattach() initializes it with
  ETHER_HDR_LEN.
  While I'm here remove setting if_mtu, it's already handled in
  ether_ifattach().

r200609:
  All vge(4) controllers support RX/TX checksum offloading for VLAN
  tagged frames so add checksum offloading capabilities. Also add
  missing VLAN hardware tagging control in ioctl handler and let
  upper stack know current VLAN capabilities.

r200613:
  Rewrite RX filter setup and simplify code.
  Now promiscuous mode and multicast handling is performed in single
  function, vge_rxfilter().
2010-01-09 00:02:40 +00:00
Pyun YongHyeon
b79a3f6583 MFC r200538,200540-200541,200543,200545,200548
r200538:
  Introduce vge_flags member in softc. The vge_flags member will
  record device specific bits. Remove vge_link and use vge_flags.
  While here, move clearing link state before mii_mediachg() as
  mii_mediachg() may affect link state.

r200540:
  Save PHY address by reading VGE_MIICFG register. For PCIe
  controllers(VT613x), we assume the PHY address is 1.
  Use the saved PHY address in MII register access routines and
  remove accessing VGE_MIICFG register.
  While I'm here save PCI express capability register which will be
  used in near future.

r200541:
  Add MSI support for VT613x controllers.

r200543:
  Increase output queue size from 64 to 255.

r200545:
  We don't have to reload EEPROM in vge_reset(). Because vge_reset()
  is called in vge_init_lock(), vge(4) always used to reload EEPROM.
  Also add more comment why vge(4) clears VGE_CHIPCFG0_PACPI bit.
  While I'm here add missing new line in vge_reset().

r200548:
  Sort function prototyes.
2010-01-08 22:26:24 +00:00
Pyun YongHyeon
ef22705259 MFC r200526-200527,200529,200531-200533,200536
r200526:
  Use PCIR_BAR instead of hard-coded value.

r200527:
  Fix typo in register definition.

r200529:
  Clear VGE_TXDESC_Q bit for transmitted frames. The VGE_TXDESC_Q bit
  seems to work like a tag that indicates 'not list end' of queued
  frames. Without having a VGE_TXDESC_Q bit indicates 'list end'. So
  the last frame of multiple queued frames has no VGE_TXDESC_Q bit.
  The hardware has peculiar behavior for VGE_TXDESC_Q bit handling.
  If the VGE_TXDESC_Q bit of descriptor was set the controller would
  fetch next descriptor. However if next descriptor's OWN bit was
  cleared but VGE_TXDESC_Q was set, it could confuse controller.
  Clearing VGE_TXDESC_Q bit for transmitted frames ensure correct
  behavior.

r200531:
  Use ANSI function definations.

r200532:
  Remove unnecessary return statement.

r200533:
  s/u_intXX_t/uintXX_t/g

r200536:
  style(9).
2010-01-08 22:08:18 +00:00
Brooks Davis
97a0b2e16c MFC r201352
If a filter has already been added, actually return EEXIST when trying
  at add it again.
2010-01-08 21:58:12 +00:00
Pyun YongHyeon
bce2400f8c MFC r200525:
Overhaul bus_dma(9) usage and fix various things.
   o Separate TX/RX buffer DMA tag from TX/RX descriptor ring DMA tag.
   o Separate RX buffer DMA tag from common buffer DMA tag. RX DMA
     tag has different restriction compared to TX DMA tag.
   o Add 40bit DMA address support.
   o Adjust TX/RX descriptor ring alignment to 64 bytes from 256
     bytes as documented in datasheet.
   o Added check to ensure TX/RX ring reside within a 4GB boundary.
     Since TX/RX ring shares the same high address register they
     should have the same high address.
   o TX/RX side bus_dmamap_load_mbuf_sg(9) support.
   o Add lock assertion to vge_setmulti().
   o Add RX spare DMA map to recover from DMA map load failure.
   o Add optimized RX buffer handler, vge_discard_rxbuf which is
     activated when vge(4) sees bad frames.
   o Don't blindly update VGE_RXDESC_RESIDUECNT register. Datasheet
     says the register should be updated only when number of
     available RX descriptors are multiple of 4.
   o Use __NO_STRICT_ALIGNMENT instead of defining VGE_FIXUP_RX which
     is only set for i386 architecture. Previously vge(4) also
     performed expensive copy operation to align IP header on amd64.
     This change should give RX performance boost on amd64
     architecture.
   o Don't reinitialize controller if driver is already running. This
     should reduce number of link state flipping.
   o Since vge(4) drops a driver lock before passing received frame
     to upper layer, make sure vge(4) is still running after
     re-acquiring driver lock.
   o Add second argument count to vge_rxeof(). The argument will
     limit number of packets could be processed in RX handler.
   o Rearrange vge_rxeof() not to allocate RX buffer if received
     frame was bad packet.
   o Removed if_printf that prints DMA map failure. This type of
     message shouldn't be used in fast path of driver.
   o Reduce number of allowed TX buffer fragments to 6 from 7. A TX
     descriptor allows 7 fragments of a frame. However the CMZ field
     of descriptor has just 3bits and the controller wants to see
     fragment + 1 in the field. So if we have 7 fragments the field
     value would be 0 which seems to cause unexpected results under
     certain conditions. This change should fix occasional TX hang
     observed on vge(4).
   o Simplify vge_stat_locked() and add number of available TX
     descriptor check.
   o vge(4) controllers lack padding short frames. Make sure to fill
     zero for the padded bytes. This closes unintended information
     disclosure.
   o Don't set VGE_TDCTL_JUMBO flag. Datasheet is not clear whether
     this bit should be set by driver or write-back status bit after
     transmission. At least vendor's driver does not set this bit so
     remove it. Without this bit vge(4) still can send jumbo frames.
   o Don't start driver when vge(4) know there are not enough RX
     buffers.
   o Remove volatile keyword in RX descriptor structure. This should
     be handled by bus_dma(9).
   o Collapse two 16bits member of TX/RX descriptor into single 32bits
     member.
   o Reduce number of RX descriptors to 252 from 256. The
     VGE_RXDESCNUM is 16bits register but only lower 8bits are valid.
     So the maximum number of RX descriptors would be 255. However
     the number of should be multiple of 4 as controller wants to
     update 4 RX descriptors at a time. This limits the maximum
     number of RX descriptor to be 252.

PR:	kern/141276, kern/141414
2010-01-08 21:37:16 +00:00
Pyun YongHyeon
f2940816a8 MFC r200519-200522
r200519:
  Remove register keyword.

r200520:
  Prefer device_printf(9) to printf(9).

r200521:
  Fix spelling in comment.

r200522:
  Prefer bus_alloc_resource_any(9) to bus_alloc_resource(9).
2010-01-08 21:25:52 +00:00
Pyun YongHyeon
6d2fb73028 MFC r198987,199414,199543,200422
Partial merge r198987:
  Use device_printf() and if_printf() instead of printf() with an explicit
  unit number and remove 'unit' members from softc.

Partial merge r199414:
  Use the bus_*() routines rather than bus_space_*() for register operations.

r199543:
  Several fixes to this driver:
  - Overhaul the locking to avoid recursion and add missing locking in a few
    places.
  - Don't schedule a task to call vge_start() from contexts that are safe to
    call vge_start() directly.  Just invoke the routine directly instead
    (this is what all of the other NIC drivers I am familiar with do).  Note
    that vge(4) does not use an interrupt filter handler which is the primary
    reason some other drivers use tasks.
  - Add a new private timer to drive the watchdog timer instead of using
    if_watchdog and if_timer.
  - Fixup detach by calling ether_ifdetach() before stopping the interface.

r200422:
  Remove driver lock assertion in MII register access. This change
  was made in r199543 to remove MTX_RECURSE. These routines can be
  called in device attach phase(e.g. mii_phy_probe()) so checking
  assertion here is not right as caller does not hold a driver lock.
2010-01-08 21:15:09 +00:00
Rick Macklem
d3db09cb06 MFC: r200999
Modify the experimental server so that it uses VOP_ACCESSX().
This is necessary in order to enable NFSv4 ACL support. The
argument to nfsvno_accchk() was changed to an accmode_t and
the function nfsrv_aclaccess() was no longer needed and,
therefore, deleted.

Reviewed by:	trasz
2010-01-08 20:25:59 +00:00
Gavin Atkinson
aab57f153b MFC r200994:
Set the locally-assigned bit in the randomly generated Ethernet address
  if we end up having to generate one.

PR:		kern/133239
Discussed with:	yongari
Approved by:	ed (mentor, implicit)
2010-01-08 10:13:27 +00:00
Alexander Leidinger
84e096effd MFC r197816:
---snip---
    Prevent paging pressure from draining arc too much
    - always drain arc if above arc_c_max - never drain arc if arc is below
      arc_c_max
---snip---
2010-01-08 09:59:13 +00:00
Antoine Brodin
f12d6d2a3f MFC r200129 to stable/8:
Remove trailing ";" in UMA_HASH_INSERT and UMA_HASH_REMOVE macros.
2010-01-07 19:37:21 +00:00
Bjoern A. Zeeb
aecc4e1724 Bump __FreeBSD_version to 800500 which should have happened already
after r198460 but was missed.

Note: that 800108 should have been 800501 with that but as there is no
functional problem here, it'll just stay as is. [1]

This will make pkg_add -r use packages-8-stable for stable/8 rather
than packages-8.0-release.

Reported by:	Paride Legovini (pl ninthfloor.org) on stable@,
		(pluknet gmail.com), jhb
Discussed with:	rwatson [1]
2010-01-07 16:18:46 +00:00
Bruce M Simpson
d2f946c444 MFC r200871:
Use ALLOW_NEW_SOURCES and BLOCK_OLD_SOURCES to signal a join or leave
 with SSM MLDv2 by default.
 This is current practice and complies with RFC 4604, as well as being
 required by production IPv6 networks in Japan.
 The behaviour may be disabled by setting the net.inet6.mld.use_allow
 sysctl/tunable to 0.

Requested by:	Hideki Yamamoto, dikshie
2010-01-07 14:15:34 +00:00
Konstantin Belousov
e1c0f1246f MFC r201347:
Allow swap out of the kernel stack for the thread with priority greater
or equial then PSOCK, not less or equial.
2010-01-07 11:41:47 +00:00
Pyun YongHyeon
02b41ac4df MFC r200088,200227-200228,200246,200264,201446
r200088:
  Add workaround to overcome hardware limitation which allows only a
  single outstanding DMA read operation. Most controllers targeted to
  client with PCIe bus interface(e.g. BCM5761) may have this
  limitation. All controllers for servers does not have this
  limitation.
  Collapsing mbuf chains to reduce number of memory reads before
  transmitting was most effective way to workaround this. I got about
  940Mbps from 850Mbps with mbuf collapsing on BCM5761. However it
  takes a lot of CPU cycles to collapse mbuf chains so add tunable to
  control the number of allowed TX buffers before collapsing. The
  default value is 0 which effectively disables the forced collapsing.
  For most cases 2 would yield best performance(about 930Mbps)
  without much sacrificing CPU cycles.
  Note the collapsing is only activated when the controller is on
  PCIe bus and the frame does not need TSO operation. TSO does not
  seem to suffer from the hardware limitation because the payload
  size is much bigger than normal IP datagram.
  Thanks to davidch@ who told me the limitation of client controllers
  and actually gave possible workarounds to mitigate the limitation.

r200227:
  Remove PHY isolate/power down code in bge_stop(). The isolation
  handler in brgphy(4) does not exist and brgphy(4) just resets the
  PHY and returns EINVAL as it has no isolation handler. I also agree
  on Marius's opinion that stop handler of every NIC driver seems to
  be the wrong place for implementing PHY isolate/power down.
  If we need PHY isolate/power down it should be implemented in
  brgphy(4) and users should administratively down the PHY.

r200228:
  Don't access jumbo frame related registers if controller lacks the
  feature. These registers are reserved on controllers that have no
  support for jumbo frame.
  Only BCM5700 has mini ring so do not poke mini ring related
  registers if controller is not BCM5700.

r200246:
  Partially revert r200228. For mini RCB case, bge(4) still have to
  disable mini ring withtout regard to mini ring support.

r200264:
  Create sysctl node(dev.bge.%d.focred_collapse) instead of
  hw.bge.forced_collapse. hw.bge.forced_collapse affects all bge(4)
  controllers on system which may not desirable behavior of the
  sysctl node. Also allow the sysctl node could be modified at any
  time.

r201446:
  Fix regression introduced in r198318. BCM5754/BCM5754M uses the
  same ASIC ID of BCM5758 such that r198318 incorecctly enabled TSO
  on BCM5754.BCM5754M controllers. BCM5754/BCM5754M needs a special
  firmware to enable TSO and bge(4) does not support firmware based
  TSO.
2010-01-07 00:55:07 +00:00
Pyun YongHyeon
56ab4ace6f MFC r199670-199671,199674,199679,199761,199807-199808
r199670:
  Fix two long standing bugs on bge(4). Most pre BCM5755 controllers
  have a DMA bug when buffer address crosses a multiple of the 4GB
  boundary(e.g. 4GB, 8GB, 12GB etc). Limit DMA address to be within
  4GB address for these controllers. The second DMA bug limits DMA
  address to be within 40bit address space. This bug applies to
  BCM5714 and BCM5715 and 5708(bce(4) controller). This is not
  actually a MAC controller bug but an issue with the embedded PCIe
  to PCI-X bridge in the device. So for BCM5714/BCM5715 controllers
  also limit the DMA address to be within 40bit address space.
  Special thanks to davidch@ who gave me detailed errata information.
  I think this change will fix long standing bge(4) instability
  issues on systems with more than 4GB memory.

r199671:
  Implement TSO for BCM5755 or newer controllers. Some controllers
  seem to require a special firmware to use TSO. But the firmware is
  not available to FreeBSD and Linux claims that the TSO performed by
  the firmware is slower than hardware based TSO. Moreover the
  firmware based TSO has one known bug which can't handle TSO if
  ethernet header + IP/TCP header is greater than 80 bytes. The
  workaround for the TSO bug exist but it seems it's too expensive
  than not using TSO at all. Some hardwares also have the TSO bug so
  limit the TSO to the controllers that are not affected TSO issues
  (e.g. 5755 or higher).
  While I'm here set VLAN tag bit to all descriptors that belengs to
  a frame instead of the first descriptor of a frame. The datasheet
  is not clear how to handle VLAN tag bit but it worked either way in
  my testing. This makes it simplify TSO configuration a little bit.

  Big thanks to davidch@ who sent me detailed TSO information.
  Without this I was not able to implement it.

r199674:
  Add missing function prototype in r199671.

r199679:
  Reduce status block size DMAed by controller. bge(4) uses single
  Tx/Rx/Rx return ring such that large part of status block was not
  used at all. All bge(4) controllers except BCM5700 AX/BX has a
  feature to control the size of status block. So use minimum status
  block size allowed in controller. This reduces number of DMAed
  status block size to 32 bytes from 80 bytes.

r199761:
  BGE_FLAG_40BIT_BUG should be set before creating DMA tags.

r199807:
  Make sure one shot MSI is enabled.

r199808:
  Fix typo which inversed the logic which in turn disabled MSI.
2010-01-07 00:44:54 +00:00
Pyun YongHyeon
eefce03276 MFC r199667-199668
r199667:
  Cache Rx producer/Tx consumer index as soon as we know status block
  update and then clear status block. Previously it used to access
  these index without synchronization which may cause problems when
  bounce buffers are used. Also add missing bus_dmamap_sync(9) in
  polling handler. Since we now update status block in driver, adjust
  bus_dmamap_sync(9) for status block.

r199668:
  For MSI case, interrupt is not shared and we don't need to force
  PCI flush to get correct status block update. Add an optimized
  interrupt handler that is activated for MSI case. Actual interrupt
  handling is done by taskqueue such that the handler does not
  require driver lock for Rx path. The MSI capable bge(4) controllers
  automatically disables further interrupt once it enters interrupt
  state so we don't need PIO access to disable interrupt in interrupt
  handler.
2010-01-06 23:42:15 +00:00
Pyun YongHyeon
1377b76a28 MFC 199663-199666
r199663:
  Due to newly added PCIe capabilities fallback code for finding the
  PCIe capability did not work right on recent controllers. Remove
  FreeBSD 6.x support code.

r199664:
  Use capability pointer to access PCIe registers rather than
  directly access them at fixed address. While I'm here don't touch
  other bits of PCIe device control register except max payload size.

r199665:
  Controller does not write Rx descriptors, remove BUS_DMASYNC_PREREAD.

r199666:
  Rearrange bge_start_locked to see we can send more frames by
  checking IFF_DRV_RUNNING and IFF_DRV_OACTIVE flags. Also if we
  have less than 16 free send BDs set IFF_DRV_OACTIVE and try it
  later. Previously bge(4) used to reserve 16 free send BDs after
  loading dma maps but hardware just need one reserved send BD. If
  prouder index has the same value of consumer index it means the Tx
  queue is empty.
  While I'm here check IFQ_DRV_IS_EMPTY first to save one lock
  operation.
2010-01-06 23:34:53 +00:00
Pyun YongHyeon
ed797ec921 MFC r199065,199115-199116,199153,199661-199662
r199065:
  Correct disabling checksum offloading for BCM5700 B0.

r199115:
  Add missing bus_dmamap_sync(9) before issuing kick command.

r199116:
  Zero out Tx/Rx descriptors before using them. Also add missing
  bus_dmamap_sync(9) after Tx descriptor initialization.

r199153:
  Controller does not update Tx descriptors(send BDs) after sending
  frames so remove unnecessary BUS_DMASYNC_PREREAD and
  BUS_DMASYNC_POSTREAD of bus_dmamap_sync(9).

r199661:
  Remove extra white space.

r199662:
  Fix typo introduced in r199011.
2010-01-06 23:26:09 +00:00
Pyun YongHyeon
1a03353586 MFC r198967,199009-199011,199014,199020,199035-199036,199054
r198967:
  Correct MSI mode register bits.

r199009:
  bge(4) already switched to use UMA backed page allocator and local
  memory allocator for jumbo frame was removed long time ago. Remove
  no more used macros.

r199010:
  Do bus_dmamap_sync call only if frame size is greater than
  standard buffer size. If controller is not capable of handling
  jumbo frame, interface MTU couldn't be larger than standard MTU
  which in turn the received should be fit in standard buffer. This
  fixes bus_dmamap_sync call for jumbo ring is called even if
  interface is configured to use standard MTU.
  Also if total frame size could be fit into standard buffer don't
  use jumbo buffers.

r199011:
  Reimplement Rx buffer allocation to handle dma map load failure.
  Introduce two spare dma maps for standard buffer and jumbo buffer
  respectively. If loading a dma map failed reuse previously loaded
  dma map. This should fix unloaded dma map is used in case of dma
  map load failure. Also don't blindly unload dma map and defer
  dma map sync and unloading operation until we know dma map for new
  buffer is successfully loaded. This change saves unnecessary dma
  load/unload operation. Previously bge(4) tried to reuse mbuf
  with unloaded dma map which is really bad thing in bus_dma(9)
  perspective.
  While I'm here update if_iqdrops if we can't allocate Rx buffers.

r199014:
  Fix I mssied in r199011. Rx ring index also should be updated.
  If we fill Rx ring full instead of half we can simplify this logic
  but this requires more experimentation.

r199020:
  Tell upper layer we support long frames. ether_ifattach()
  initializes it to ETHER_HDR_LEN so we have to override it after
  calling ether_ifattch().
  While I'm here remove setting if_mtu value, it's initialized in
  ether_ifattach().

r199035:
  Don't count input errors twice, we always read input errors from
  MAC in bge_tick. Previously it used to show more number of input
  errors. I noticed actual input errors were less than 8% even for
  64 bytes UDP frames generated by netperf.
  Since we always access BGE_RXLP_LOCSTAT_IFIN_DROPS register in
  bge_tick, remove useless code protected by #ifdef notyet.

r199036:
  Count number of inbound packets which were chosen to be discarded
  as input errors. Also count out of receive BDs as input errors.

r199054:
  Partially revert r199035.
  Revision 1.158 says only lower ten bits of
  BGE_RXLP_LOCSTAT_IFIN_DROPS register is valid. For BCM5761 case it
  seems the controller maintains 16bits value for the register.
  However 16bits are still too small to count all dropped packets
  happened in a second. To get a correct counter we have to read the
  register in bge_rxeof() which would be too expensive.
2010-01-06 23:02:35 +00:00
Pyun YongHyeon
2c8f00d0c7 MFC r198923-198924,198927-198928
r198923:
  Use correct dma tag for jumbo buffer.

r198924:
  Covert bge_newbuf_std to use bus_dmamap_load_mbuf_sg(9). Note,
  bge_newbuf_std still has a bug for handling dma map load failure
  under high network load. Just reusing mbuf is not enough as driver
  already unloaded the dma map of the mbuf. Graceful recovery needs
  more work.
  Ideally we can just update dma address part of a Rx descriptor
  because the controller never overwrite the Rx descriptor. This
  requires some Rx initialization code changes and it would be done
  later after fixing other incorrect bus_dma(9) usages.

r198927:
  Remove common DMA tag used for TX/RX mbufs and create Tx DMA tag
  and Rx DMA tag separately. Previously it used a common mbuf DMA tag
  for both Tx and Rx path but Rx buffer(standard ring case) should
  have a single DMA segment and maximum buffer size of the segment
  should be less than or equal to MCLBYTES. This change also make it
  possible to add TSO with minor changes.

r198928:
  Make bge_newbuf_std()/bge_newbuf_jumbo() returns actual error code
  for buffer allocation. If driver know we are out of Rx buffers let
  controller stop. This should fix panic when interface is run even
  if it had no configured Rx buffers.
2010-01-06 22:45:49 +00:00
Gavin Atkinson
ef80613c4b MFC r200820:
Support the tablet in (at least) the Toshiba Portege M200 Tablet PC.
  This device only appears on the ACPI bus, so isn't caught by the current
  entry for it in the uart(4) ISA attachment.

PR:		kern/140172
Reviewed by:	jhb, marcel
Approved by:	ed (mentor, implicit)
2010-01-06 20:40:41 +00:00
Jung-uk Kim
a0a23c9727 MFC: r200251
- Try pre-allocating all FIBs upfront.  Previously we tried pre-allocating
128 FIBs first and allocated more later if necessary.  Remove now unused
definitions from the header file[1].
- Force sequential bus scanning.  It seems parallel scanning is in fact
slower and causes more harm than good[1].  Adjust a comment to reflect that.
2010-01-06 20:28:47 +00:00
Qing Li
130fd3bc32 MFC r201319
Remove a deleted comment line that was brought back by
my previous commit.
2010-01-05 22:37:05 +00:00
Qing Li
a17a2dcab6 MFC r201285
Consolidate the route message generation code for when address
aliases were added or deleted. The announced route entry for
an address alias is no longer empty because this empty route
entry was causing some route daemon to fail and exit abnormally.
2010-01-05 22:33:10 +00:00
Qing Li
c5f368cee7 MFC r201284
Multiple IPv6 addresses of the same prefix can be installed on the
same interface. The first address will install the prefix route into
the kernel routing table and that prefix will be marked as on-link.
Without RADIX_MPATH enabled, the other address aliases of the same
prefix will update the prefix reference count but no other routes
will be installed. Consequently the prefixes associated with these
addresses would not be marked as on-link. As such, incoming packets
destined to these address aliases will fail the ND6 on-link check
on input. This patch fixes the above problem by searching the kernel
routing table and try to find an on-link prefix on the given interface.
2010-01-05 22:28:23 +00:00
Qing Li
32c5340155 MFC r201282, r201543
r201282
-------
The proxy arp entries could not be added into the system over the
IFF_POINTOPOINT link types. The reason was due to the routing
entry returned from the kernel covering the remote end is of an
interface type that does not support ARP. This patch fixes this
problem by providing a hint to the kernel routing code, which
indicates the prefix route instead of the PPP host route should
be returned to the caller. Since a host route to the local end
point is also added into the routing table, and there could be
multiple such instantiations due to multiple PPP links can be
created with the same local end IP address, this patch also fixes
the loopback route installation failure problem observed prior to
this patch. The reference count of loopback route to local end would
be either incremented or decremented. The first instantiation would
create the entry and the last removal would delete the route entry.

r201543
-------
The IFA_RTSELF address flag marks a loopback route has been installed
for the interface address. This marker is necessary to properly support
PPP types of links where multiple links can have the same local end
IP address. The IFA_RTSELF flag bit maps to the RTF_HOST value, which
was combined into the route flag bits during prefix installation in
IPv6. This inclusion causing the prefix route to be unusable. This
patch fixes this bug by excluding the IFA_RTSELF flag during route
installation.

PR:		ports/141342, kern/141134
2010-01-05 22:14:55 +00:00
John Baldwin
02bcb7ecc3 MFC 201196:
Change vlan interfaces to cope more usefully with the parent interface being
renamed.  Previously the vlan interfaces would lose their configuration as if
the parent interface had been physically removed.  Now vlan interfaces ignore
rename events.
- Add a new ifnet flag (IFF_RENAMING) that is set while an ifnet is being
  renamed.  This flag can be checked in ifnet departure/arrival event
  handlers to treat rename events differently.
- Change the ifnet departure event handler in the if_vlan(4) driver to
  ignore departure events due to a trunk interface being renamed.
2010-01-05 18:25:41 +00:00
John Baldwin
e10b0dfd66 MFC 200847:
- Rename the __tcpi_(snd|rcv)_mss fields of the tcp_info structure to remove
  the leading underscores since they are now implemented.
- Implement the tcpi_rto and tcpi_last_data_recv fields in the tcp_info
  structure.
2010-01-05 17:04:14 +00:00
Alexander Motin
579a42937d MFC 200977:
Avoid false positive probe on ICH6 chipsets.
2010-01-05 14:03:46 +00:00
Alexander Motin
aaa35fa853 MFC 200991:
Teach twe driver to report array stripe size to GEOM.
2010-01-05 14:02:12 +00:00
Alexander Motin
328562d78a MFC 200969:
Report stripe size only if physical sector size is not equal to logical.
2010-01-05 13:58:18 +00:00
Alexander Motin
2aa244f295 MFC r200934:
Add two disk ioctls, giving user-level tools information about disk/array
stripe (optimal access block) size and offset.
2010-01-05 13:51:23 +00:00
Alexander Motin
ae07f94f6f MFC r200942:
Make geom_concat to passthrough stripe parameters of the first component,
hoping that rest will fit.
2010-01-05 13:50:14 +00:00
Alexander Motin
3bda9adcd9 MFC r200940:
As soon as geom_raid3 reports it's own stripe as sector size, report largest
underlying provider's stripe, multiplied by number of data disks in array,
due to transformation done, as array stripe.
2010-01-05 13:49:18 +00:00
Alexander Motin
c730493bbf MFC r200935:
As soon as mirror has no own stripes, report largest stripe of unrerlying
components, hoping others fit, if they are not equal.
2010-01-05 13:47:55 +00:00
Alexander Motin
48eae87f12 MFC r200933:
Make geom_stripe report it's stripe size to upper layers.
2010-01-05 13:46:39 +00:00
John Baldwin
eee4cfb98f MFC 201351:
Use stricter checking to match possible vlan clones by not allowing extra
garbage characters around or within the tag.
2010-01-04 22:44:48 +00:00
Warner Losh
1b1bff673f Revert 201158. DEFAULTS isn't for this kind of thing.a 2010-01-04 21:33:10 +00:00
Shteryana Shopova
aed7a0f878 MFC r201254:
Make sure the multicast forwarding cache entry's stall queue is properly
initialized before trying to insert an entry into it.

PR:		kern/142052
Reviewed by:	bms
2010-01-04 15:58:36 +00:00
Hajimu UMEMOTO
479812d91c MFC r200055, r200102:
- Teach an IPv6 to the debug prints.
- Use INET_ADDRSTRLEN and INET6_ADDRSTRLEN rather than hard
  coded number.
2010-01-04 15:22:38 +00:00
Hajimu UMEMOTO
30feab0076 MFC r200027: Teach an IPv6 to send_pkt() and ipfw_tick().
It fixes the issue which keep-alive doesn't work for an IPv6.
2010-01-04 15:05:11 +00:00
Jaakko Heinonen
7231db3aea MFC r198940:
File flags handling fixes for ext2fs:

- Disallow setting of flags not supported by ext2fs.
- Map EXT2_APPEND_FL to SF_APPEND.
- Map EXT2_IMMUTABLE_FL to SF_IMMUTABLE.
- Map EXT2_NODUMP_FL to UF_NODUMP.

Note that ext2fs doesn't support user settable append and immutable flags.
EXT2_NODUMP_FL is an user settable flag also on Linux.

PR:		kern/122047
Approved by:	trasz (mentor)
2010-01-04 14:35:36 +00:00
Xin LI
faeec9b29a MFC r200727:
Apply fix for Solaris bug 6764159: restore_object() makes a call
that can block while having a tx open but not yet committed
(onnv revision 7994)

Submitted by:	mm
Approved by:	pjd
Obtained from:	OpenSolaris
2010-01-03 03:10:28 +00:00
Xin LI
617528f9ab MFC r200726:
Apply fix for Solaris bug 6801979: zfs recv can fail with E2BIG
(onnv revision 8986)

PR:		kern/141355
Requested by:	mm
Submitted by:	pjd
Obtained from:	OpenSolaris
2010-01-03 03:05:30 +00:00
Xin LI
66be3718aa MFC r200724:
Apply fix for Solaris bug  6462803 zfs snapshot -r failed because
filesystem was busy.

PR:		kern/141387
Submitted by:	mm
Approved by:	pjd
Obtained from:	OpenSolaris (onnv 8989:cfce31f4eebf)
2010-01-03 02:58:05 +00:00
Warner Losh
47cc17a5a7 Welcome to 2010. 2010-01-02 20:34:13 +00:00
Gavin Atkinson
dfb1009882 MFC r200993: Small spelling fix, "Ethetnet" -> "Ethernet"
Approved by:	ed (mentor)
2010-01-02 13:07:14 +00:00
Marius Strobl
91de583634 MFC: r201126
Account for firmware versions which include the CDMA interrupts in
the OFW device tree.
2010-01-01 17:30:42 +00:00
Gavin Atkinson
d36f5405ca MFC 200637:
Don't panic due to unlocking an unowned mutex if we fail during attach.

PR:		kern/139053
Reviewed by:	scottl
Approved by:	ed (mentor)
2009-12-31 12:58:08 +00:00
Konstantin Belousov
e6b37c3a7f MFC r201134:
Add a knob to allow reclaim of the directory vnodes that are source of
the namecache records.
2009-12-31 11:49:13 +00:00
Ed Schouten
35e0c29fdf MFC r198185:
Print backspaces after echoing an EOF.

  Applications like shells expect EOF to give no graphical output, while
  our implementation prints ^D by default (tunable with stty echoctl).
  Make the new implementation behave like the old TTY code. Print two
  backspaces afterwards.

I totally forgot to MFC this, because the 8.0 freeze took a little
longer than I expected.

Reminded by:	koitsu
2009-12-31 10:53:04 +00:00
Jaakko Heinonen
e15f9ffcb0 MFC r198291:
Unloading of the nfscl module is unsupported because newnfslock doesn't
support unloading. It's not trivial to implement newnfslock unloading so
for now just admit that unloading is unsupported and refuse to attempt
unload in all nfscl module event handlers.

Approved by:	trasz (mentor)
2009-12-31 07:34:38 +00:00
Jaakko Heinonen
44aa9b63f6 MFC r198290:
Fix ordering of nfscl_modevent() and ncl_uninit(). nfscl_modevent() must
be called after ncl_uninit() when unloading the nfscl module because
ncl_uninit() uses ncl_iod_mutex which is destroyed in nfscl_modevent().

Approved by:	trasz (mentor)
2009-12-31 07:32:04 +00:00
Jaakko Heinonen
d2129b5030 MFC r198289:
Fix comment typos.

Approved by:	trasz (mentor)
2009-12-31 07:28:43 +00:00
Andrew Thompson
c774a6224a Sync usbdevs to fix the build.
Pointy hat:	me
2009-12-31 06:59:15 +00:00
Andrew Thompson
10280e6d17 MFC r201071
Compact USB_VENDOR_X and USB_PRODUCT_Y in the quirk tables.
2009-12-31 00:30:45 +00:00
Andrew Thompson
dc72f7b46c MFC r201028
Use macros to strip off USB_VENDOR_ and USB_PRODUCT_ from some id tables to make
 them more compact and readable.
2009-12-31 00:20:54 +00:00
Andrew Thompson
4ab13ae19c MFC r200887
Shorten the USB_QUIRK_ENTRY macro and undef it at the end, its only internal.
2009-12-31 00:19:52 +00:00
Andrew Thompson
596828bab2 MFC r200886
Move all Mass Storage Quirks over to the USB quirk module.

Submitted by:	Hans Petter Selasky
2009-12-31 00:19:16 +00:00
Andrew Thompson
d5b8cd8366 MFC r200885
Sync usb vendor/product defines to p4
2009-12-31 00:18:38 +00:00
Andrew Thompson
c13e362184 MFC r200827
Add missed usb product define in r200826.
2009-12-31 00:17:59 +00:00
Andrew Thompson
ba0bb08c53 MFC r200826
add new ID to UFTDI driver.

Submitted by:	YAMAMOTO, Shigeru
2009-12-31 00:17:09 +00:00
Andrew Thompson
a33c9e7236 MFC r200825
- add support for more than 2 audio channels. [1]
 - add support for more sample rates

Submitted by:	[1] ariff (earlier version), Hans Petter Selasky
2009-12-31 00:15:36 +00:00
Andrew Thompson
afc2c8aef9 MFC r200823
Add more OHCI pci ids.
2009-12-31 00:14:37 +00:00
Andrew Thompson
3a1f0cab5d MFC r200822
Add more EHCI pci ids.
2009-12-31 00:14:02 +00:00
Andrew Thompson
9d774551fc MFC r200658
Keep list sorted.
2009-12-31 00:13:24 +00:00
Andrew Thompson
71db0b9765 MFC r200657
Add a bunch of new 3G ids obtained from from various operating systems and
 Internet sources.
2009-12-31 00:12:38 +00:00
Andrew Thompson
ee4e4d544f MFC r200653
Use the EVENTHANDLER system to hook into the usb device configuration and
 perform a function such as ejecting a 3G autoinstaller disk. The eventhandler
 system properly tracks threads and is safe to unload, remove the
 setting/clearing of a function pointer in the kernel by u3g(4) which included a
 tsleep for safety.
2009-12-31 00:10:26 +00:00
Andrew Thompson
2478604ee7 MFC r200652
If the runcount is non-zero in eventhandler_deregister() then one or more
 threads are executing the eventhandler, sleep in this case to make it safe for
 module unload. If the runcount was up then an entry would have been marked
 EHE_DEAD_PRIORITY so use this as a trigger to do the wakeup in
 eventhandler_prune_list().
2009-12-31 00:09:47 +00:00
Andrew Thompson
e065c35e2a MFC r200396
Wrap long lines.
2009-12-31 00:08:59 +00:00
Andrew Thompson
a1028b88ba MFC r200395
Add a quirk for the Curitel UM175 where setting multiplexing for call
 management over the data endpoint causes communication to die.

 Take this one step further and model it on the existing NetBSD quirk and import
 other device IDs from them.

Obtained from:	NetBSD
2009-12-31 00:08:17 +00:00
Andrew Thompson
65701ca05f MFC r200308
Fix hardware issue with FTDI chips: avoid sending a zero length packet due to
 hardware sending garbage on ZLPs.

Reported by:	Corey Smith
Submitted by:	HPS
2009-12-31 00:07:37 +00:00
Andrew Thompson
3656a8fb15 MFC r200307
Fix dwSignature for NCM mode and add extra debug output.
2009-12-31 00:06:52 +00:00
Andrew Thompson
bb1fb02ae2 MFC r200306
Add new device ids.

PR:		usb/140951, usb/140923
Submitted by:	Romain Tartiere, Brett Glass
2009-12-31 00:06:12 +00:00