]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/log
FreeBSD/stable/8.git
14 years agoMFC: r202159
brueffer [Fri, 15 Jan 2010 19:53:36 +0000 (19:53 +0000)]
MFC: r202159

Remove useless .TE groff macro.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202416 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r201836
brueffer [Fri, 15 Jan 2010 19:42:09 +0000 (19:42 +0000)]
MFC: r201836

Remove unnecessary quoting and markup, add missing punctuation.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202413 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r202006
marius [Fri, 15 Jan 2010 19:12:33 +0000 (19:12 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202410 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r201932
marius [Fri, 15 Jan 2010 19:06:33 +0000 (19:06 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202408 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r201901
marius [Fri, 15 Jan 2010 16:57:49 +0000 (16:57 +0000)]
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

git-svn-id: svn://svn.freebsd.org/base/stable/8@202404 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r201396, r201410
marius [Fri, 15 Jan 2010 16:54:59 +0000 (16:54 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202402 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r201395
marius [Fri, 15 Jan 2010 16:46:03 +0000 (16:46 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202400 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r201199
marius [Fri, 15 Jan 2010 16:42:39 +0000 (16:42 +0000)]
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).

git-svn-id: svn://svn.freebsd.org/base/stable/8@202398 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r201009
marius [Fri, 15 Jan 2010 16:29:40 +0000 (16:29 +0000)]
MFC: r201009

Remove clause 3 from Izumi Tsutsui's licenses.

Obtained from: NetBSD

git-svn-id: svn://svn.freebsd.org/base/stable/8@202395 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r201008
marius [Fri, 15 Jan 2010 16:27:57 +0000 (16:27 +0000)]
MFC: r201008

Style changes

Obtained from: NetBSD (mc146818reg.h)

git-svn-id: svn://svn.freebsd.org/base/stable/8@202393 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r201007
marius [Fri, 15 Jan 2010 16:25:17 +0000 (16:25 +0000)]
MFC: r201007

Correct my e-mail address.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202391 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r201007
marius [Fri, 15 Jan 2010 16:21:32 +0000 (16:21 +0000)]
MFC: r201007

Add a man page for mk48txx(4).

Requested by: n_hibma
Obtained from: NetBSD (original version)

git-svn-id: svn://svn.freebsd.org/base/stable/8@202389 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r201005, r201371
marius [Fri, 15 Jan 2010 15:47:31 +0000 (15:47 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202384 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r201004
marius [Fri, 15 Jan 2010 15:42:14 +0000 (15:42 +0000)]
MFC: r201004

Remove clause 3 and 4 from TNF licenses.

Obtained from: NetBSD

git-svn-id: svn://svn.freebsd.org/base/stable/8@202382 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r201003
marius [Fri, 15 Jan 2010 15:40:44 +0000 (15:40 +0000)]
MFC: r201003

Style changes

git-svn-id: svn://svn.freebsd.org/base/stable/8@202380 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years ago- Hook up the default implementations of the MSI/MSI-X pcib_if methods
marius [Fri, 15 Jan 2010 15:38:49 +0000 (15:38 +0000)]
- 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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202377 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200947
marius [Fri, 15 Jan 2010 15:36:12 +0000 (15:36 +0000)]
MFC: r200947

Add missing locking in intr_bind().

git-svn-id: svn://svn.freebsd.org/base/stable/8@202373 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200946
marius [Fri, 15 Jan 2010 15:28:57 +0000 (15:28 +0000)]
MFC: r200946

Execute the cleanup handlers before jumping to the kernel just
like the other architectures do.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202371 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200945
marius [Fri, 15 Jan 2010 15:27:17 +0000 (15:27 +0000)]
MFC: r200945

- Consistently wrap debugging in NETIF_DEBUG. This basically merges
  NetBSD rev 1.19.
- Make the functions match their prototypes regarding static.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202370 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r200440 to stable/8:
antoine [Fri, 15 Jan 2010 14:24:32 +0000 (14:24 +0000)]
MFC r200440 to stable/8:
  Install firmware(9) examples.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202361 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoUpdate to a 26-Nov-2009 release.
ru [Fri, 15 Jan 2010 14:20:01 +0000 (14:20 +0000)]
Update to a 26-Nov-2009 release.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202360 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: revision 201342
nyan [Fri, 15 Jan 2010 12:27:46 +0000 (12:27 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202352 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200944
marius [Fri, 15 Jan 2010 12:07:30 +0000 (12:07 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202350 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFH r201051:
marck [Fri, 15 Jan 2010 12:02:22 +0000 (12:02 +0000)]
MFH r201051:

  To remove a server, one should use double backslash, and half of them
  are eaten by shell.  Fix this.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202348 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: revision 201339 and 201340
nyan [Fri, 15 Jan 2010 11:26:20 +0000 (11:26 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202343 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r200416:
dougb [Fri, 15 Jan 2010 03:28:46 +0000 (03:28 +0000)]
MFC r200416:
Simplify handling of MTREEFILE relative to DESTDIR

Make the message about a missing MTREEFILE combined with -U
more informative

MFC r200425:
Over time things that used to be files/directories/links can change
to something else. So add code to detect when things don't match and
give the user choices about how to fix it.

If we're using -P and something in the above check needs to be moved
we need to have the directory there for it, so create it at the
beginning and delete empty versions of it at the end.

The case where something used to be a file or link and now is supposed
to be a directory (e.g., /etc/security) is especially dangerous, so
make failure to install a necessary directory in $DESTDIR a fatal error.

MFC r200700:
In the places where find is used that the user may see the results,
first pipe it to sort so that order of processing will be deterministic
and like things will be grouped together.

MFC r200701:
Fix an indentation issue, no functional changes

MFC r200708:
Fix a problem with how mergemaster handles the hard links for /.cshrc
and /.profile. The problem is that install(1) will unlink the old file
before it installs the new one, which means that in the best case we
have to compare the changes for the old file twice.

So, change the logic to first test to see if the link exists, then
install the file. Then if the link was there and we're using -i, just
create the link in /root and be done with it. Otherwise display the
message to the user and give them the option.

Because we are now sorting things before doing the comparison we can
know conclusively that the files in / should be the sources, and the
files in /root will be the targets, so adjust the paths accordingly.

While I'm here, split a too-long error message into two lines and
just return at the end of handling these files instead of setting
the variable that says "do nothing" and then returning at the end
of the function anyway.

MFC r201291:
Add some patches contributed by jhb:
1. Don't prompt the user for "-U but no db" error if we're using -a
2. Add an option to delete stale rc.d files automatically if the user
has DELETE_STALE_RC_FILES in their rc file. Lack of command line option
for this is not an oversight.
3. Add []'s around the terminal $ for the $FreeBSD$ test for -F

For one bug raised by jhb I did a more thorough solution:
There were a lot of things that "snuck in" between the end of the test
for -r and the start of the comparison. One of them is the creation of
the mtree db, as pointed out by jhb. Fix this problem more thoroughly
by moving the end of the test down to where it should/used to be, right
before the comparison. As a result, indent the interloping code to match.

MFC r201292:
Document the DELETE_STALE_RC_FILES option introduced in r201291. This is
an "rc file only" option by design.

While I'm here, update the comments in the example rc file to indicate
which command line options they relate to, and correct the defaults
for a couple of options.

MFC r201293:
It's not necessary to include both Op and Fl for command line options
included in the text, so use only the latter.

Clarify that using -U doesn't make sense in combination with -a

MFC r201323:
If we are using -p it does not make any sense to even create the
MTREENEW file since it will never be used.

MFC r201765:
Update copyright date

Update delete_temproot() to include the error message if it fails,
and clean up the places where it's called.

If there are no files left in temproot when the comparison is done
delete it without prompting. This should make "automated" runs of
mergemaster without -a a little easier.

Document the new behavior in the man page.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202337 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r201368:
dougb [Fri, 15 Jan 2010 03:04:43 +0000 (03:04 +0000)]
MFC r201368:
Update named_flags comment regarding not using it for -u and -c

git-svn-id: svn://svn.freebsd.org/base/stable/8@202332 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r201367, r201370:
dougb [Fri, 15 Jan 2010 03:03:02 +0000 (03:03 +0000)]
MFC r201367, r201370:
Virtualize the location of "the configuration directory" instead of
hard-coding it to be /etc/namedb

git-svn-id: svn://svn.freebsd.org/base/stable/8@202331 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r201626:
dougb [Fri, 15 Jan 2010 02:55:19 +0000 (02:55 +0000)]
MFC r201626:
- Move potentially offensive quotes I committed recently to fortunes-o.
- Reference date.
- Be more clear on context.

MFC r201764:
For the now-infamous Rumsfeld quote:

Change "there're" to "there are" which is consistent with the vast
majority of on line references.

Remove a spurious trailing "

Update the citation text with a suggestion from des.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202329 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r201601:
dougb [Fri, 15 Jan 2010 02:18:07 +0000 (02:18 +0000)]
MFC r201601:
Remove more duplicates
Minor reformatting on a few

git-svn-id: svn://svn.freebsd.org/base/stable/8@202327 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r201769:
yongari [Thu, 14 Jan 2010 22:36:06 +0000 (22:36 +0000)]
MFC r201769:
  Enable ste(4). ste(4) should work on all architectures.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202322 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r200958:
yongari [Thu, 14 Jan 2010 22:33:46 +0000 (22:33 +0000)]
MFC r200958:
  Document newly added loader tunable/sysctl variable
  dev.ste.%d.int_rx_mod.
  While I'm here add .Xr vlan as ste(4) supports long frames.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202320 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r200950,200955,200965-200966,201767-201768
yongari [Thu, 14 Jan 2010 22:26:52 +0000 (22:26 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202318 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r200904-200908,200910-200913
yongari [Thu, 14 Jan 2010 22:15:51 +0000 (22:15 +0000)]
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().

git-svn-id: svn://svn.freebsd.org/base/stable/8@202314 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r200854,200856,200865,200873,200875,200877,200884
yongari [Thu, 14 Jan 2010 22:00:33 +0000 (22:00 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202311 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r200853:
yongari [Thu, 14 Jan 2010 21:45:39 +0000 (21:45 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202309 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r202120:
gallatin [Thu, 14 Jan 2010 21:30:06 +0000 (21:30 +0000)]
MFC: r202120:
 Update mxge(4) firmware to 1.4.48b (latest available) from Myricom.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202305 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r202121:
gallatin [Thu, 14 Jan 2010 21:10:36 +0000 (21:10 +0000)]
MFC r202121:
 Use better default RSS hash (src + dst, rather than just src port)

git-svn-id: svn://svn.freebsd.org/base/stable/8@202303 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC 202119: Fix reporting of 10G Twinax media
gallatin [Thu, 14 Jan 2010 20:59:02 +0000 (20:59 +0000)]
MFC 202119: Fix reporting of 10G Twinax media

git-svn-id: svn://svn.freebsd.org/base/stable/8@202302 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r200798,200801,200803-200804,200808,200810
yongari [Thu, 14 Jan 2010 20:47:49 +0000 (20:47 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202299 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoPartial merge r199559:
yongari [Thu, 14 Jan 2010 20:38:40 +0000 (20:38 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202297 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r201345
rmacklem [Thu, 14 Jan 2010 17:35:07 +0000 (17:35 +0000)]
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

git-svn-id: svn://svn.freebsd.org/base/stable/8@202292 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200938
marius [Wed, 13 Jan 2010 21:23:27 +0000 (21:23 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202265 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200926
marius [Wed, 13 Jan 2010 21:21:29 +0000 (21:21 +0000)]
MFC: r200926

Recognize the NS16552 found in PCIe-based sun4u machines.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202262 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200925
marius [Wed, 13 Jan 2010 21:19:46 +0000 (21:19 +0000)]
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).

git-svn-id: svn://svn.freebsd.org/base/stable/8@202260 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200924
marius [Wed, 13 Jan 2010 21:17:45 +0000 (21:17 +0000)]
MFC: r200924

Style changes.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202258 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200923
marius [Wed, 13 Jan 2010 21:16:07 +0000 (21:16 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202256 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200922
marius [Wed, 13 Jan 2010 21:13:50 +0000 (21:13 +0000)]
MFC: r200922

Fix whitespace according to style(9).

git-svn-id: svn://svn.freebsd.org/base/stable/8@202254 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200921
marius [Wed, 13 Jan 2010 21:12:27 +0000 (21:12 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202252 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200920
marius [Wed, 13 Jan 2010 21:08:57 +0000 (21:08 +0000)]
MFC: r200920

- Sort the prototypes.
- Add macros to ease the access of device configuration space in
  ofw_pcibus_setup_device().

git-svn-id: svn://svn.freebsd.org/base/stable/8@202251 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200918
marius [Wed, 13 Jan 2010 21:04:56 +0000 (21:04 +0000)]
MFC: r200918

Add structures for OFW MSI/MSI-X support. These are identical for
both sun4u and sun4v.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202248 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200917
marius [Wed, 13 Jan 2010 21:03:04 +0000 (21:03 +0000)]
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).

git-svn-id: svn://svn.freebsd.org/base/stable/8@202246 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200916
marius [Wed, 13 Jan 2010 20:59:36 +0000 (20:59 +0000)]
MFC: r200916

Remove devices which are/were only relevant for sun4u.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202244 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200915
marius [Wed, 13 Jan 2010 20:51:21 +0000 (20:51 +0000)]
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).

git-svn-id: svn://svn.freebsd.org/base/stable/8@202241 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200914
marius [Wed, 13 Jan 2010 20:40:49 +0000 (20:40 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202237 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200880
marius [Wed, 13 Jan 2010 20:35:27 +0000 (20:35 +0000)]
MFC: r200880

- Correct an off-by-one error when calculating the end of a child
  range.
- Spell the PCI TLA in uppercase.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202234 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200879
marius [Wed, 13 Jan 2010 20:32:54 +0000 (20:32 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202232 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200878
marius [Wed, 13 Jan 2010 20:07:45 +0000 (20:07 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202228 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200876
marius [Wed, 13 Jan 2010 20:05:32 +0000 (20:05 +0000)]
MFC: r200876

Make these constants unsigned which is more appropriate.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202226 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200874
marius [Wed, 13 Jan 2010 20:03:24 +0000 (20:03 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202225 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200815, r200816
marius [Wed, 13 Jan 2010 19:59:13 +0000 (19:59 +0000)]
MFC: r200815, r200816

Provide and consume missing module dependency information.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202223 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: 197164
marius [Wed, 13 Jan 2010 19:55:51 +0000 (19:55 +0000)]
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).

git-svn-id: svn://svn.freebsd.org/base/stable/8@202221 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC 199607, 200797, 201270, 201669:
jhb [Wed, 13 Jan 2010 18:12:21 +0000 (18:12 +0000)]
MFC 199607, 200797, 201270, 201669:
Use pthread_once() to initialize the thread-local storage for localtime()
and gmtime() and _once() to initialize gmt state rather than home-rolled
versions using pthread mutex locks.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202201 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC 201215:
jhb [Tue, 12 Jan 2010 19:55:07 +0000 (19:55 +0000)]
MFC 201215:
Add support for configuring vlan(4) interfaces as child devices similar to
wlan(4) interfaces.  vlan(4) interfaces are listed via a new 'vlans_<IF>'
variable.  If a vlan interface is a number, then that number is treated as
the vlan tag for the interface and the interface will be named '<IF>.<tag>'.
Otherwise, the vlan tag must be provided via a vlan parameter in a
'create_args_<vlan>' variable.

While I'm here, fix a few nits in rc.conf(5) and mention create_args_<IF> in
the description of cloned_interfaces.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202167 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC 201202:
jhb [Tue, 12 Jan 2010 18:47:40 +0000 (18:47 +0000)]
MFC 201202:
Use reallocf() to simplify some logic.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202164 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r201444:
brooks [Tue, 12 Jan 2010 07:33:33 +0000 (07:33 +0000)]
MFC r201444:

  The size of credential messages is limited by CMGROUP_MAX rather than
  NGROUPS.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202140 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r201955:
brooks [Tue, 12 Jan 2010 06:14:24 +0000 (06:14 +0000)]
MFC r201955:
  Improve the comment about CMGROUP_MAX.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202138 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r201954:
brooks [Tue, 12 Jan 2010 06:11:36 +0000 (06:11 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202137 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r201953:
brooks [Tue, 12 Jan 2010 06:09:56 +0000 (06:09 +0000)]
MFC r201953:
  Correct the explination text for the kern.ngroups.  It reflects the
  number of supplemental groups, not the total number of groups.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202136 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r201443:
brooks [Tue, 12 Jan 2010 06:00:56 +0000 (06:00 +0000)]
MFC r201443:
  Add vlan(4) to all GENERIC kernels.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202134 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r201544
qingli [Tue, 12 Jan 2010 00:04:13 +0000 (00:04 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202132 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoSync mxge(4) with head:
gallatin [Mon, 11 Jan 2010 20:32:51 +0000 (20:32 +0000)]
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

git-svn-id: svn://svn.freebsd.org/base/stable/8@202112 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r201029
rmacklem [Mon, 11 Jan 2010 19:30:23 +0000 (19:30 +0000)]
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.)

git-svn-id: svn://svn.freebsd.org/base/stable/8@202106 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC 201522:
jhb [Mon, 11 Jan 2010 18:42:29 +0000 (18:42 +0000)]
MFC 201522:
Expose the upper 256 ptys in the default devfs rules.  I should have updated
this when expanding the old pty(4) driver to use 512 ptys by default.  This
is more important for 7.x.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202100 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r200770:
kib [Mon, 11 Jan 2010 12:35:16 +0000 (12:35 +0000)]
MFC r200770:
Remove VI_OBJDIRTY and make sure that OBJ_MIGHTBEDIRTY is set only for
vnode-backed vm objects.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202082 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r200026,201801: Swap carp(4) log levels.
ru [Mon, 11 Jan 2010 12:32:06 +0000 (12:32 +0000)]
MFC: r200026,201801: Swap carp(4) log levels.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202081 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r201538, r201539
brueffer [Mon, 11 Jan 2010 05:19:51 +0000 (05:19 +0000)]
MFC: r201538, r201539

Catch up with the VFS_VPTOFH(9) -> VOP_VPTOFH(9) repocopy that happened
almost three years ago in r166794.

Add a missing word.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202068 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r201143:
delphij [Mon, 11 Jan 2010 02:31:00 +0000 (02:31 +0000)]
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

git-svn-id: svn://svn.freebsd.org/base/stable/8@202059 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC rev 201269, 201373:
marcel [Sun, 10 Jan 2010 23:51:02 +0000 (23:51 +0000)]
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).

git-svn-id: svn://svn.freebsd.org/base/stable/8@202052 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r210428: sh: Add a regression test that tries out all arithmetic ops.
jilles [Sun, 10 Jan 2010 16:58:12 +0000 (16:58 +0000)]
MFC r210428: sh: Add a regression test that tries out all arithmetic ops.

The gaps in the numbering sequence cannot really be avoided, as HEAD changes
are not necessarily merged in the same order as they are made (if they are
merged at all).

git-svn-id: svn://svn.freebsd.org/base/stable/8@202017 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC 201151:
fabient [Sun, 10 Jan 2010 16:08:14 +0000 (16:08 +0000)]
MFC 201151:
 Use VFS_{LOCK,UNLOCK}_GIANT() around the call to vrele().

git-svn-id: svn://svn.freebsd.org/base/stable/8@202012 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC 201023:
fabient [Sun, 10 Jan 2010 16:04:32 +0000 (16:04 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202009 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC 201021:
fabient [Sun, 10 Jan 2010 16:00:00 +0000 (16:00 +0000)]
MFC 201021:
Log process mappings for existing processes at PMC start time.

git-svn-id: svn://svn.freebsd.org/base/stable/8@202008 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r201743:
kib [Sun, 10 Jan 2010 11:25:34 +0000 (11:25 +0000)]
MFC r201743:
Give some information on SF_MNOWAIT flag.

MFC r201759 (by brueffer):
Fix a typo and bump date for the previous commit.

MFC r201760:
Further fix grammar.

git-svn-id: svn://svn.freebsd.org/base/stable/8@201994 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r201756:
delphij [Sun, 10 Jan 2010 07:08:11 +0000 (07:08 +0000)]
MFC r201756:

Re-apply onnv-gate revisions 7994 and 8986 (corresponds to FreeBSD
revision 200726 and 200727).

Reviewed by:  mm@

git-svn-id: svn://svn.freebsd.org/base/stable/8@201987 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r200693:
yongari [Sat, 9 Jan 2010 01:17:31 +0000 (01:17 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@201877 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r200641,200676
yongari [Sat, 9 Jan 2010 00:36:28 +0000 (00:36 +0000)]
MFC r200641,200676

r200641:
  Document newly added loader tunable and sysctl variables.
   o hw.vge.msi_disable
   o dev.vge.%d.int_holdoff
   o dev.vge.%d.rx_coal_pkt
   o dev.vge.%d.tx_coal_pkt

r200676:
  Document more VIA Velocity family controllers to vge(4). Previously
  it mentioned only VT6122. While I'm here remove the mention of
  VT3119 which seems to be VIA's internal model name and VT3119
  wouldn't be available to end users.

  Reviewed by:  brueffer

git-svn-id: svn://svn.freebsd.org/base/stable/8@201875 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC: r201397
brueffer [Sat, 9 Jan 2010 00:27:23 +0000 (00:27 +0000)]
MFC: r201397

Add one more supported controller.

git-svn-id: svn://svn.freebsd.org/base/stable/8@201872 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r200696,200740,200756,200758-200759,200972
yongari [Sat, 9 Jan 2010 00:26:57 +0000 (00:26 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@201871 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r200638:
yongari [Sat, 9 Jan 2010 00:17:43 +0000 (00:17 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@201868 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r200616-200617,200635,200639,200644
yongari [Sat, 9 Jan 2010 00:12:59 +0000 (00:12 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@201866 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC 200615:
yongari [Sat, 9 Jan 2010 00:07:03 +0000 (00:07 +0000)]
MFC 200615:
  Add hardware MAC statistics support. This statistics could be
  extracted from dev.vge.%d.stats sysctl node.

git-svn-id: svn://svn.freebsd.org/base/stable/8@201862 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r200551-200552,200555,200558,200609,200613
yongari [Sat, 9 Jan 2010 00:02:40 +0000 (00:02 +0000)]
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().

git-svn-id: svn://svn.freebsd.org/base/stable/8@201860 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r200538,200540-200541,200543,200545,200548
yongari [Fri, 8 Jan 2010 22:26:24 +0000 (22:26 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@201840 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r200526-200527,200529,200531-200533,200536
yongari [Fri, 8 Jan 2010 22:08:18 +0000 (22:08 +0000)]
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).

git-svn-id: svn://svn.freebsd.org/base/stable/8@201837 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r201352
brooks [Fri, 8 Jan 2010 21:58:12 +0000 (21:58 +0000)]
MFC r201352

  If a filter has already been added, actually return EEXIST when trying
  at add it again.

git-svn-id: svn://svn.freebsd.org/base/stable/8@201835 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r200525:
yongari [Fri, 8 Jan 2010 21:37:16 +0000 (21:37 +0000)]
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

git-svn-id: svn://svn.freebsd.org/base/stable/8@201832 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r201349:
brooks [Fri, 8 Jan 2010 21:27:09 +0000 (21:27 +0000)]
MFC r201349:
Ignore .glimpse_* files as generated by the glimpse target.  Also ignore
cscope.* files.

git-svn-id: svn://svn.freebsd.org/base/stable/8@201826 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r200519-200522
yongari [Fri, 8 Jan 2010 21:25:52 +0000 (21:25 +0000)]
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).

git-svn-id: svn://svn.freebsd.org/base/stable/8@201825 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

14 years agoMFC r198987,199414,199543,200422
yongari [Fri, 8 Jan 2010 21:15:09 +0000 (21:15 +0000)]
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@201823 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f