Commit Graph

150347 Commits

Author SHA1 Message Date
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
Antoine Brodin
158c24fd61 MFC r200440 to stable/8:
Install firmware(9) examples.
2010-01-15 14:24:32 +00:00
Ruslan Ermilov
f96c46c6ab Update to a 26-Nov-2009 release. 2010-01-15 14:20:01 +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
Dmitry Morozovsky
2eea36f8d9 MFH r201051:
To remove a server, one should use double backslash, and half of them
  are eaten by shell.  Fix this.
2010-01-15 12:02:22 +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
Doug Barton
ad9bb0898d 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.
2010-01-15 03:28:46 +00:00
Doug Barton
bda5bb9d4d MFC r201368:
Update named_flags comment regarding not using it for -u and -c
2010-01-15 03:04:43 +00:00
Doug Barton
06ee3ef09d MFC r201367, r201370:
Virtualize the location of "the configuration directory" instead of
hard-coding it to be /etc/namedb
2010-01-15 03:03:02 +00:00
Doug Barton
209597ee90 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.
2010-01-15 02:55:19 +00:00
Doug Barton
ede27ce6d0 MFC r201601:
Remove more duplicates
Minor reformatting on a few
2010-01-15 02:18:07 +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
33e6efefc1 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.
2010-01-14 22:33:46 +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
John Baldwin
8e42544da7 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.
2010-01-13 18:12:21 +00:00
John Baldwin
d46150d432 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.
2010-01-12 19:55:07 +00:00
John Baldwin
bd048c87c0 MFC 201202:
Use reallocf() to simplify some logic.
2010-01-12 18:47:40 +00:00
Brooks Davis
cb8922f4cb MFC r201444:
The size of credential messages is limited by CMGROUP_MAX rather than
  NGROUPS.
2010-01-12 07:33:33 +00:00