Commit Graph

76194 Commits

Author SHA1 Message Date
Marius Strobl
033a5c8ce1 - 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.
2009-12-25 21:53:20 +00:00
Marius Strobl
1b02305785 Remove clause 3 and 4 from TNF licenses.
Obtained from:	NetBSD
2009-12-25 21:41:05 +00:00
Marius Strobl
a64ac9c1e3 Style changes 2009-12-25 21:32:26 +00:00
Bjoern A. Zeeb
e4ff598ec6 Remove extra spaces (no functional change).
MFC after:	3 days
2009-12-25 21:14:05 +00:00
Rick Macklem
8da45f2c6e 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
MFC after:	2 weeks
2009-12-25 20:44:19 +00:00
Bjoern A. Zeeb
095809b084 Remove an unused global.
MFC after:	3 days
2009-12-25 20:03:03 +00:00
Gavin Atkinson
cd3135e9ec 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)
MFC after:	2 weeks
2009-12-25 19:57:28 +00:00
Gavin Atkinson
f0b108cf03 Small spelling fix, "Ethetnet" -> "Ethernet"
Approved by:	ed (mentor)
MFC after:	1 week
2009-12-25 19:38:12 +00:00
Alexander Motin
c078c19633 Teach twe driver to report array stripe size to GEOM. 2009-12-25 17:34:43 +00:00
Marius Strobl
10a290af39 - 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.
2009-12-25 15:03:05 +00:00
Alexander Motin
f45946a8f7 Avoid false positive probe on ICH6 chipsets. 2009-12-25 07:59:31 +00:00
Robert Watson
c7ca33d138 Minor comment tweaks in rmlocks.
MFC after:	3 days
2009-12-25 01:16:24 +00:00
Pyun YongHyeon
55219c9044 Remove wrong assertion. 2009-12-25 00:23:47 +00:00
Alexander Motin
ce8332d468 Report stripe size only if physical sector size is not equal to logical. 2009-12-24 21:54:44 +00:00
Pyun YongHyeon
cb05ec6606 ether_ifattach sets if_mtu, remove unnecessary code. 2009-12-24 20:45:33 +00:00
Pyun YongHyeon
da57a8c835 Update if_iqdrops in case of RX buffer allocation failure. 2009-12-24 20:43:31 +00:00
Pyun YongHyeon
b4c170e1f5 Add suspend/resume support as well as basic WOL.
While I'm here simplify SIOCSIFCAP handler.
2009-12-24 18:17:53 +00:00
Luigi Rizzo
4a3c1bd27f fix poor indentation resulting from a merge 2009-12-24 17:35:28 +00:00
Pyun YongHyeon
fabbaac560 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.
2009-12-24 17:22:15 +00:00
Marius Strobl
3438bdc53e Merge from amd64/i386:
Implement support for interrupt descriptions.
2009-12-24 15:43:37 +00:00
Marius Strobl
b1c13fc739 Add missing locking in intr_bind(). 2009-12-24 15:40:08 +00:00
Marius Strobl
005ad6daf8 Execute the cleanup handlers before jumping to the kernel just
like the other architectures do.
2009-12-24 15:23:51 +00:00
Marius Strobl
5e01e025a2 - Consistently wrap debugging in NETIF_DEBUG. This basically merges
NetBSD rev 1.19.
- Make the functions match their prototypes regarding static.
2009-12-24 15:16:16 +00:00
Marius Strobl
4794ebf3b9 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.
2009-12-24 15:14:35 +00:00
Alexander Motin
5f9b1143ac Make geom_concat to passthrough stripe parameters of the first component,
hoping that rest will fit.
2009-12-24 14:32:21 +00:00
Alexander Motin
113d8e5046 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.
2009-12-24 13:38:02 +00:00
Marius Strobl
d92734d25a - 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.
2009-12-24 12:27:22 +00:00
Alexander Motin
92f60381d9 As soon as mirror has no own stripes, report largest stripe of unrerlying
components, hoping others fit, if they are not equal.
2009-12-24 12:17:22 +00:00
Alexander Motin
8b30323843 Add two disk ioctls, giving user-level tools information about disk/array
stripe (optimal access block) size and offset.
2009-12-24 11:05:23 +00:00
Alexander Motin
f00919d2fc Make geom_stripe report it's stripe size to upper layers. 2009-12-24 10:43:44 +00:00
Xin LI
dcc2b1ff46 Adapt OpenBSD pf's "sloopy" TCP state machine which is useful for Direct
Server Return mode, where not all packets would be visible to the load
balancer or gateway.

This commit should be reverted when we merge future pf versions.  The
benefit it would provide is that this version does not break any existing
public interface and thus won't be a problem if we want to MFC it to
earlier FreeBSD releases.

Discussed with:	mlaier
Obtained from:	OpenBSD
Sponsored by:	iXsystems, Inc.
MFC after:	1 month
2009-12-24 00:43:44 +00:00
Rui Paulo
bbb8e19daf Add hwpmc_arm.c 2009-12-23 23:53:30 +00:00
Rui Paulo
0ce207d2af Intel XScale hwpmc(4) support.
This brings hwpmc(4) support for 2nd and 3rd generation XScale cores.
Right now it's enabled by default to make sure we test this a bit.
When the time comes it can be disabled by default.
Tested on Gateworks boards.

A man page is coming.

Obtained from:	//depot/user/rpaulo/xscalepmc/...
2009-12-23 23:16:54 +00:00
Marius Strobl
48533564ca Recognize the NS16552 found in PCIe-based sun4u machines. 2009-12-23 22:31:43 +00:00
Marius Strobl
c39f5f5af4 - 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).
2009-12-23 22:25:23 +00:00
Marius Strobl
ee57d839bb Style changes. 2009-12-23 22:11:33 +00:00
Marius Strobl
6ed76228c1 - 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.
2009-12-23 22:02:34 +00:00
Marius Strobl
46c9b5d9bd Fix whitespace according to style(9). 2009-12-23 21:51:41 +00:00
Marius Strobl
926f4e43c6 - 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.
2009-12-23 21:38:59 +00:00
Marius Strobl
9cc21da577 - Sort the prototypes.
- Add macros to ease the access of device configuration space in
  ofw_pcibus_setup_device().
2009-12-23 21:25:16 +00:00
Marius Strobl
36fd650f09 Add structures for OFW MSI/MSI-X support. These are identical for
both sun4u and sun4v.
2009-12-23 21:07:49 +00:00
Marius Strobl
ec1ac5ad07 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).
2009-12-23 21:04:31 +00:00
Marius Strobl
d15bfa6899 - Remove devices which are/were only relevant for sun4u. 2009-12-23 20:52:45 +00:00
Marius Strobl
7bb518f115 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).
2009-12-23 20:42:14 +00:00
Marius Strobl
4d116858df 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.
2009-12-23 20:23:04 +00:00
Pyun YongHyeon
ae49e7a695 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().
2009-12-23 19:38:22 +00:00
Pyun YongHyeon
95a3c23b51 Correct STE_COUNTDOWN register offset. The datasheet was wrong. 2009-12-23 19:26:38 +00:00
Pyun YongHyeon
13e052e416 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.
2009-12-23 19:21:37 +00:00
Pyun YongHyeon
8657caa66b Implement hardware MAC statistics counter support. The counters
could be accessed with dev.ste.0.stats sysctl node.
2009-12-23 19:18:07 +00:00
Luigi Rizzo
84918f5bc8 mostly style changes, such as removal of trailing whitespace,
reformatting to avoid unnecessary line breaks, small block
restructuring to avoid unnecessary nesting, replace macros
with function calls, etc.

As a side effect of code restructuring, this commit fixes one bug:
previously, if a realloc() failed, memory was leaked. Now, the
realloc is not there anymore, as we first count how much memory
we need and then do a single malloc.
2009-12-23 18:53:11 +00:00
Pyun YongHyeon
bfe051bd2e 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.
2009-12-23 18:42:25 +00:00
Pyun YongHyeon
5b7e31187e Don't report link status if driver is not running. 2009-12-23 18:28:47 +00:00
Pyun YongHyeon
931ec15a83 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.
2009-12-23 18:24:22 +00:00
Pyun YongHyeon
38c52cfdc1 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.
2009-12-23 17:54:24 +00:00
Pyun YongHyeon
55d7003e48 Don't reinitialize controller if driver is already running. This
reduces number of link state UP/DOWN changes.
2009-12-23 17:46:11 +00:00
Randall Stewart
0e39bbc4dd Add missing function that doesintr naming and
init.
2009-12-23 14:55:33 +00:00
Randall Stewart
d0a679ea35 This is a list of the files for RMI's md_root
file system to get to multi-user. There are
still some rough edges, rge has an issue. And
someone held a spin lock to long.. But its
coming along :-)
2009-12-23 14:48:26 +00:00
Robert Watson
912f6323cd When warning about possible netisr configuration problems during boot,
report using "netisr_init" rather than "netisr2", which was the development
name for the project.

MFC after:	3 days
2009-12-23 12:33:59 +00:00
Robert Watson
0a32e29f59 Refine netisr.c comments a bit. 2009-12-23 12:31:27 +00:00
Luigi Rizzo
3ae19c3ba3 fix build with the new fast lookup structure.
Also remove some unnecessary headers
2009-12-23 12:15:21 +00:00
Luigi Rizzo
6aab896346 fix build on 64-bit architectures.
Also fix the indentation on a few lines.
2009-12-23 12:00:50 +00:00
Marcel Moolenaar
d9c849eceb Calculate the average CPU clock frequency and export that through
the hw.freq.cpu sysctl variable. This can be used by ports that
need to know "the" CPU frequency.
2009-12-23 06:52:12 +00:00
Marcel Moolenaar
2191712fd1 Export the bus, cpu and itc frequencies under the hw.freq sysctl node.
The frequencies are in MHz (i.e. a value of 1000 represents 1GHz). The
frequencies are rounded to the nearest whole MHz.

While here, rename and re-type bus_frequency, processor_frequency and
itc_frequency to bus_freq, cpu_freq and itc_freq and make them static.
As unsigned integers, the hw.freq.cpu sysctl can more easily be made
generic (across all architectures) making porting easier.

MFC after:	3 days
2009-12-23 04:48:42 +00:00
Marcel Moolenaar
30fd085c78 Add a bit definition for invalid timestamp in the record header. 2009-12-23 04:39:05 +00:00
Andrew Thompson
47d54fbb13 Shorten the USB_QUIRK_ENTRY macro and undef it at the end, its only internal. 2009-12-23 01:41:52 +00:00
Andrew Thompson
eb58441685 Move all Mass Storage Quirks over to the USB quirk module.
Submitted by:	Hans Petter Selasky
2009-12-23 01:16:24 +00:00
Andrew Thompson
7b360bcc6c Sync usb vendor/product defines to p4
Submitted by:	HPS
2009-12-23 01:12:54 +00:00
Pyun YongHyeon
81598b3e5e 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.
2009-12-22 23:57:10 +00:00
Marius Strobl
b748710c34 - Correct an off-by-one error when calculating the end of a child
range.
- Spell the PCI TLA in uppercase.
2009-12-22 21:53:19 +00:00
Marius Strobl
63cd5b6d38 - 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.
2009-12-22 21:49:53 +00:00
Marius Strobl
8bf72e61a7 - 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.
2009-12-22 21:48:18 +00:00
Pyun YongHyeon
ec89b8a856 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.
2009-12-22 21:44:25 +00:00
Marius Strobl
ea77e7bb3f Make these constants unsigned which is more appropriate. 2009-12-22 21:42:54 +00:00
Pyun YongHyeon
c0270e602a 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.
2009-12-22 21:39:34 +00:00
Marius Strobl
1bba41a506 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.
2009-12-22 21:02:46 +00:00
Pyun YongHyeon
8d9f6dd948 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().
2009-12-22 20:57:30 +00:00
John Baldwin
b677f368bb Don't build zfsboot, gptzfsboot, and zfsloader if WITHOUT_ZFS is enabled.
MFC after:	1 week
2009-12-22 20:56:33 +00:00
Bruce M Simpson
aa16623133 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
MFC after:	1 week
2009-12-22 20:40:22 +00:00
Pyun YongHyeon
10f695ee22 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().
2009-12-22 20:11:56 +00:00
Alexander Motin
7aab51b33e Add support for Intel SCH PATA controller.
PR:		kern/140251
2009-12-22 19:48:06 +00:00
Pyun YongHyeon
4465097b57 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().
2009-12-22 19:32:16 +00:00
Luigi Rizzo
de240d1013 merge code from ipfw3-head to reduce contention on the ipfw lock
and remove all O(N) sequences from kernel critical sections in ipfw.

In detail:

 1. introduce a IPFW_UH_LOCK to arbitrate requests from
     the upper half of the kernel. Some things, such as 'ipfw show',
     can be done holding this lock in read mode, whereas insert and
     delete require IPFW_UH_WLOCK.

  2. introduce a mapping structure to keep rules together. This replaces
     the 'next' chain currently used in ipfw rules. At the moment
     the map is a simple array (sorted by rule number and then rule_id),
     so we can find a rule quickly instead of having to scan the list.
     This reduces many expensive lookups from O(N) to O(log N).

  3. when an expensive operation (such as insert or delete) is done
     by userland, we grab IPFW_UH_WLOCK, create a new copy of the map
     without blocking the bottom half of the kernel, then acquire
     IPFW_WLOCK and quickly update pointers to the map and related info.
     After dropping IPFW_LOCK we can then continue the cleanup protected
     by IPFW_UH_LOCK. So userland still costs O(N) but the kernel side
     is only blocked for O(1).

  4. do not pass pointers to rules through dummynet, netgraph, divert etc,
     but rather pass a <slot, chain_id, rulenum, rule_id> tuple.
     We validate the slot index (in the array of #2) with chain_id,
     and if successful do a O(1) dereference; otherwise, we can find
     the rule in O(log N) through <rulenum, rule_id>

All the above does not change the userland/kernel ABI, though there
are some disgusting casts between pointers and uint32_t

Operation costs now are as follows:

  Function				Old	Now	  Planned
-------------------------------------------------------------------
  + skipto X, non cached		O(N)	O(log N)
  + skipto X, cached			O(1)	O(1)
XXX dynamic rule lookup			O(1)	O(log N)  O(1)
  + skipto tablearg			O(N)	O(1)
  + reinject, non cached		O(N)	O(log N)
  + reinject, cached			O(1)	O(1)
  + kernel blocked during setsockopt()	O(N)	O(1)
-------------------------------------------------------------------

The only (very small) regression is on dynamic rule lookup and this will
be fixed in a day or two, without changing the userland/kernel ABI

Supported by: Valeria Paoli
MFC after:	1 month
2009-12-22 19:01:47 +00:00
Pyun YongHyeon
1bf71544de Add minimal dealy while ste(4) is waiting for the end of active DMA
cycle.
2009-12-22 19:00:18 +00:00
Pyun YongHyeon
a1b2c20925 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.
2009-12-22 18:57:07 +00:00
John Baldwin
43d9473499 - 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.

Reviewed by:	rwatson
MFC after:	2 weeks
2009-12-22 15:47:40 +00:00
Andrew Gallatin
57e42c95a4 Don't take the driver mutex in mxge_tick(), as it
is run with the mutex held.

Submitted by: rwatson
MFC after:	3 days
2009-12-22 15:41:58 +00:00
Luigi Rizzo
46fdc2bf60 some mostly cosmetic changes in preparation for upcoming work:
+ in many places, replace &V_layer3_chain with a local
  variable chain;
+ bring the counter of rules and static_len within ip_fw_chain
  replacing static variables;
+ remove some spurious comments and extern declaration;
+ document which lock protects certain data structures
2009-12-22 13:53:34 +00:00
Edward Tomasz Napierala
5a8eb3a9d1 Cosmetic fixes. 2009-12-22 09:03:59 +00:00
Andrew Thompson
46e977391b Add missed usb product define in r200826. 2009-12-22 02:15:36 +00:00
Andrew Thompson
cc92254a07 add new ID to UFTDI driver.
Submitted by:	YAMAMOTO, Shigeru
2009-12-22 02:13:23 +00:00
Andrew Thompson
afbfddd901 - 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-22 02:11:37 +00:00
Andrew Thompson
f1ea98c024 Set correct USB device description
Submitted by:	Paul B Mahol
2009-12-22 02:04:16 +00:00
Andrew Thompson
725f67ad7b Add more OHCI pci ids.
Submitted by:	Hans Petter Selasky
2009-12-22 01:59:17 +00:00
Andrew Thompson
bae15f4ab1 Add more EHCI pci ids.
Submitted by:	Hans Petter Selasky
2009-12-22 01:57:34 +00:00
Alexander Motin
d4060fa67d Make graid3 fallback to malloc() when component request size is bigger
then maximal prepared UMA zone size. This fixes crash with MAXPHYS > 128K.
2009-12-21 23:31:03 +00:00
Gavin Atkinson
eb8e36c9f6 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)
MFC after:	2 weeks
2009-12-21 22:57:40 +00:00
Alexander Motin
922706175e Spell AMD properly. 2009-12-21 21:47:33 +00:00
Marius Strobl
6a963456fd Add missing module dependency information. 2009-12-21 21:41:33 +00:00
Marius Strobl
75b02cac5a Provide and consume missing module dependency information. 2009-12-21 21:29:16 +00:00
Alexander Motin
45e1aff18a 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.
2009-12-21 21:27:56 +00:00
Pyun YongHyeon
084dc54bb3 Sort function prototyes. 2009-12-21 20:42:23 +00:00
Pyun YongHyeon
f2632c3b48 style(9) 2009-12-21 20:18:01 +00:00
John Baldwin
8e9683767c Remove commented out prototype for ifinit(). This prototype has been
commented out since 1.1 and has not been present in <sys/systm.h> since at
least 1.1 of that file.  It is also not needed in FreeBSD due to SYSINIT().
2009-12-21 20:09:19 +00:00
Pyun YongHyeon
9c7dcf0e47 Remove trailing white spaces. 2009-12-21 20:02:12 +00:00
Pyun YongHyeon
56af54f28f s/u_intXX_t/uintXX_t/g 2009-12-21 20:00:27 +00:00
Pyun YongHyeon
42306cb0b3 o Remove unnecessary return statement.
o Remove register keyword.
2009-12-21 19:56:11 +00:00
Pyun YongHyeon
60270842b7 Use ANSI function definations. 2009-12-21 19:50:29 +00:00
Edward Tomasz Napierala
9340fc72e6 Implement NFSv4 ACL support for UFS.
Reviewed by:	rwatson
2009-12-21 19:39:10 +00:00
Yoshihiro Takahashi
db5dd5cff8 Move cursor position after putting a character.
MFC after:	1 week
2009-12-21 14:59:23 +00:00
Konstantin Belousov
49e3050e6c VI_OBJDIRTY vnode flag mirrors the state of OBJ_MIGHTBEDIRTY vm object
flag. Besides providing the redundand information, need to update both
vnode and object flags causes more acquisition of vnode interlock.
OBJ_MIGHTBEDIRTY is only checked for vnode-backed vm objects.

Remove VI_OBJDIRTY and make sure that OBJ_MIGHTBEDIRTY is set only for
vnode-backed vm objects.

Suggested and reviewed by:	alc
Tested by:	pho
MFC after:	3 weeks
2009-12-21 12:29:38 +00:00
Randall Stewart
c33e262ffe Fixes so kdb works. 2009-12-21 11:29:30 +00:00
Robert Noland
66ab1230f1 Fix a handful of issues with via agp support.
* Read the pci capability register to identify AGP 3 support
  * Add missing smaller aperture sizes for AGP3 chips.
  * Fix the aperture size calculation on AGP2 chips.
    All sizes between 32M and 256M reported as 256M.
  * Add \n to error string.

This all seems to get the CLE266 EPIA-M board agp working properly, now
back to work on drm.

MFC after:	2 weeks
2009-12-21 03:28:05 +00:00
Ed Schouten
907b48bc05 Fix indentation. 2009-12-20 22:55:27 +00:00
Pyun YongHyeon
33a0d70b86 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.
2009-12-20 19:45:46 +00:00
Pyun YongHyeon
564340e7cf 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.
2009-12-20 19:11:32 +00:00
Pyun YongHyeon
c743849615 Correct fragment bit definition in comments. 2009-12-20 18:53:34 +00:00
Randall Stewart
2be832193d Adds JC's fix to get rid of stray intr's.
Obtained from:	JC - jayachandraanc@netlogicmicro.com
2009-12-20 17:53:35 +00:00
Alexander Motin
c357f2c827 Add VIA CX700/VX800 chipsets SATA/PATA support.
PR:		kern/121521
Tested by:	Alex Deiter
2009-12-20 16:23:11 +00:00
Alexander Motin
1905fcfe0a Fairly set master/slave shared PIO/WDMA timings on ITE 821x controllers.
Previous implementation could only limit mode, but not rise it back.
2009-12-20 15:03:57 +00:00
Pyun YongHyeon
12ea9beca9 Swap VGE_TXQTIMER and VGE_RXQTIMER register definition. Pending
timer for Tx queue is at 0x3E.
2009-12-19 20:45:23 +00:00
Marcel Moolenaar
1c56376494 Remove a warning in DELAY about large delays. In kern_shutdown.c
we use excessive delays quite habitually.
2009-12-19 20:42:56 +00:00
Ed Schouten
8dc9b4cf04 Let access overriding to TTYs depend on the cdev_priv, not the vnode.
Basically this commit changes two things, which improves access to TTYs
in exceptional conditions. Basically the problem was that when you ran
jexec(8) to attach to a jail, you couldn't use /dev/tty (well, also the
node of the actual TTY, e.g. /dev/pts/X). This is very inconvenient if
you want to attach to screens quickly, use ssh(1), etc.

The fixes:

- Cache the cdev_priv of the controlling TTY in struct session. Change
  devfs_access() to compare against the cdev_priv instead of the vnode.
  This allows you to bypass UNIX permissions, even across different
  mounts of devfs.

- Extend devfs_prison_check() to unconditionally expose the device node
  of the controlling TTY, even if normal prison nesting rules normally
  don't allow this. This actually allows you to interact with this
  device node.

To be honest, I'm not really happy with this solution. We now have to
store three pointers to a controlling TTY (s_ttyp, s_ttyvp, s_ttydp).
In an ideal world, we should just get rid of the latter two and only use
s_ttyp, but this makes certian pieces of code very impractical (e.g.
devfs, kern_exit.c).

Reported by:	Many people
2009-12-19 18:42:12 +00:00
Xin LI
dd0c145752 Apply fix for Solaris bug 6462803: zfs snapshot -r failed because
filesystem was busy
(onnv revision 8989)

Submitted by:	mm
Approved by:	pjd
Obtained from:	OpenSolaris
MFC after:	2 weeks
2009-12-19 11:49:20 +00:00
Xin LI
24a41d7ec6 Apply fix for Solaris bug 6801979: zfs recv can fail with E2BIG
(onnv revision 8986)

Requested by:	mm
Submitted by:	pjd
Obtained from:	OpenSolaris
MFC after:	2 weeks
2009-12-19 11:47:22 +00:00
Xin LI
775f802393 Apply fix Solaris bug 6462803 zfs snapshot -r failed because
filesystem was busy.

Submitted by:	mm
Approved by:	pjd
MFC after:	2 weeks
2009-12-19 11:43:39 +00:00
Edward Tomasz Napierala
28d3fd007e Interpret VAPPEND correctly in vaccess_acl_nfs4(9). 2009-12-19 11:41:52 +00:00
Pyun YongHyeon
7fc94bc4e0 Add rudimentary WOL support. While I'm here remove enabling
busmastering/memory address in resume path. Bus driver will handle
that.
2009-12-18 22:14:28 +00:00
Pyun YongHyeon
45e564a90b Make sure to enable Next Page bit for IP1001. Otherwise the PHY
fails to re-establishe 1000baseT link after downgrading to
10/100Mbps link.
2009-12-18 21:57:51 +00:00
Marcel Moolenaar
e7f42eade6 Fix ub_env_enum(): syscall() returns 0 when properly invoked. 2009-12-18 21:12:37 +00:00
Ed Schouten
e6d84d057a Make the wchan names of pts(4) fit in top(1).
Just like a similar change we made to the TTY code about half a year
ago, make these strings look similar.

Suggested by:	Jille Timmermans <jille@quis.cx>
2009-12-18 20:11:29 +00:00
Jean-Sébastien Pédron
b469a43897 Add new "hw.psm.tap_enabled" tunable and sysctl.
This tunable allows one to enable (1) or disable (0) gestures like tap
and tap-hold on Synaptics TouchPad when the Extended mode isn't enabled
(ie. "hw.psm.synaptics_support" not set).

By default, the value is -1 in order to keep the current behaviour of
not enabling/disabling gestures explicitly.

PR:		kern/139272
Submitted by:	David Horn <dhorn2000 AT gmail DOT com>
Reviewed by:	David Horn <dhorn2000 AT gmail DOT com>
2009-12-18 17:46:57 +00:00
Ruslan Ermilov
bec5f27f73 Added proper attribution.
Requested by:	luigi
2009-12-18 17:22:21 +00:00
John Baldwin
becf6b3db8 - Add missing newlines to some error messages.
- Add interrupt descriptions when using mulitple MSI-X interrupts.

Reviewed by:	jfv
2009-12-18 16:14:31 +00:00
John Baldwin
390cee8729 - Create a separate section in in the MI NOTES file for PCI wireless NIC
drivers and move bwi(4) there from the PCI Ethernet NIC section.
- Move ath(4) and ral(4) to the MI NOTES file.

Reviewed by:	rpaulo
2009-12-18 16:13:21 +00:00
Joseph Koshy
68c3e04122 Recognize Intel CPUs with Family 0x6, Models 0x1E and 0x1F.
Submitted by:	Marc Unangst <mju at panasas dot com>
2009-12-18 15:01:46 +00:00
Alexander Motin
7485a8eb62 Remove duplicate devstat_start_transaction_bio() call. It is already called
from geom_disk. Dulicate call causes wrong queue depth and busy accounting.
2009-12-18 14:41:30 +00:00
Konstantin Belousov
9ae781dfcf Signal 0 is used to check the permission for current process to signal
target one. Since r184058, linux_do_tkill() calls tdsignal() instead of
kill(), without checking for validity of supplied signal number. Prevent
panic when supplied signal is 0 by finishing work after checks.

Found and tested by:	scf
MFC after:	3 days
2009-12-18 14:27:18 +00:00
Ruslan Ermilov
a46a1e767d - Fixed incorrect watchdog timeout setting: MSB of a 2-byte
value is obtained by dividing it by 256, not by 2550; also,
  one second is 10^9 nanoseconds, not 1800000000 nanoseconds.

- Due to rounding error, setting watchdog to a really small
  timeout (<1 sec) was turning the watchdog off.  It should
  set the watchdog to a small timeout instead.

- Implemented error checking in ipmi_wd_event(), as required
  by watchdog(9).

PR:		kern/130512
Submitted by:	Dmitrij Tejblum

- Additionally, check that the timeout value is within the
  supported range, and if it's too large, act as required by
  watchdog(9).

MFC after:	3 days
2009-12-18 12:10:42 +00:00
Andrew Thompson
b340b7be10 Keep list sorted. 2009-12-18 00:36:30 +00:00
Andrew Thompson
c0e2c17865 Add a bunch of new 3G ids obtained from from various operating systems and
Internet sources.

Obtained from:	Linux, NetBSD, OpenBSD, etc
2009-12-18 00:34:58 +00:00
Warner Losh
488141d9e8 Place holder ptrace mips module. Not entirely sure what's required
here yet, so I've not connected it to the build.  I think that we'll
need to move something into the processor specific part of the mips
port by requiring mips_cpu_ptrace or platform_cpu_ptrace be provided
by the ports to get/set processor specific registers, ala SSE
registers on x86.
2009-12-17 23:55:49 +00:00
Alexander Motin
6988053e0e Serverworks OSB4 has no 0x4a (piomode) register, do not touch it.
Also OSB4 has some problems with UDMA transfers, limit it to WDMA2.
2009-12-17 23:42:09 +00:00
Luigi Rizzo
1328a38b96 Add some experimental code to log traffic with tcpdump,
similar to pflog(4).
To use the feature, just put the 'log' options on rules
you are interested in, e.g.

	ipfw add 5000 count log ....

and run
	tcpdump -ni ipfw0 ...

net.inet.ip.fw.verbose=0 enables logging to ipfw0,
net.inet.ip.fw.verbose=1 sends logging to syslog as before.

More features can be added, similar to pflog(), to store in
the MAC header metadata such as rule numbers and actions.
Manpage to come once features are settled.
2009-12-17 23:11:16 +00:00
Andrew Thompson
2a4c6157ca 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-17 21:42:10 +00:00
Andrew Thompson
2b54315009 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().

Reviewed by:	jhb
2009-12-17 21:17:13 +00:00
Pyun YongHyeon
dd77a0532b Remove unused member variable of softc. 2009-12-17 19:48:54 +00:00
Pyun YongHyeon
610dfa9399 Actually clear interrupts. Writing 0 has no effect. 2009-12-17 18:03:05 +00:00
Pyun YongHyeon
3b2b8afb3c 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.
2009-12-17 18:00:25 +00:00
Gavin Atkinson
64a026bdcc Don't panic due to unlocking an unowned mutex if we fail during attach.
PR:		kern/139053
Reviewed by:	scottl
Approved by:	ed (mentor)
MFC after:	2 weeks
2009-12-17 17:46:08 +00:00
Luigi Rizzo
8c5d93d4d4 Now that ipfw is split into multiple files, we need
to list them all in the Makefile for the module,
otherwise it won't load due to missing symbols.

The problem only affected head with ipfw built as a module.

Reported by David Horn
2009-12-17 17:44:34 +00:00
Pyun YongHyeon
ed03d795ff Remove unused VGE_ETHER_ALIGN definition. 2009-12-17 17:38:06 +00:00
Luigi Rizzo
60ab046a41 simplify and document lookup_next_rule() 2009-12-17 17:27:12 +00:00
Yoshihiro Takahashi
ef7b7ac106 Fix debug messages of bd_io().
MFC after:	1 week
2009-12-17 13:14:11 +00:00
Luigi Rizzo
59cd9f65f9 simplify the code that finds the next rule after reinjections
MFC after:	1 week
2009-12-17 12:27:54 +00:00
Matt Jacob
e7d829a46c Fix argument order in a call to mtx_init.
MFC after:	1 week
2009-12-17 00:22:56 +00:00
Matt Jacob
ab429a9218 Fix argument order in a call to mtx_init.
MFC after:	1 week
2009-12-17 00:21:12 +00:00
Warner Losh
8ffab8645b Revert 200606. 2009-12-16 21:53:56 +00:00
Pyun YongHyeon
83accfdbd5 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.
2009-12-16 20:03:43 +00:00
Pyun YongHyeon
a931e5497b Add new flag VGE_FLAG_SUSPENDED to mark suspended state and
remove suspended member in softc.
2009-12-16 19:49:23 +00:00
Pyun YongHyeon
7129fb20d6 Add hardware MAC statistics support. This statistics could be
extracted from dev.vge.%d.stats sysctl node.
2009-12-16 19:41:40 +00:00
Pyun YongHyeon
5f07fd19e2 Rewrite RX filter setup and simplify code.
Now promiscuous mode and multicast handling is performed in single
function, vge_rxfilter().
2009-12-16 19:32:44 +00:00
Luigi Rizzo
53638988bc remove a duplicate sysctl entry 2009-12-16 18:03:35 +00:00
Pyun YongHyeon
38aa43c511 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.
2009-12-16 18:03:25 +00:00
Alexander Motin
8bff82df5a Large I/Os on Promise controllers reported to cause UDMA ICRC errors and
subsequent timeouts. Restore previous limit for now, at least until
I will have hardware to experiment.

PR:             kern/141438
2009-12-16 17:42:02 +00:00
Warner Losh
42b3331b8a Fix compiling FREEBSD_COMPAT[4,5,6] without FREEBSD_COMPAT7.
Note: Not sure this is the right way to do compat, but it makes the
headers consistent with the implementations.
2009-12-16 17:17:40 +00:00
John Baldwin
dfd775727f Add entries to NOTES for the modular phy support so that these options are
documented.

PR:		docs/141358
Submitted by:	Bruce Cran
2009-12-16 16:24:32 +00:00
Luigi Rizzo
1b5691c61e bring back a couple of #include that are supplied by nesting,
and explain why they are used.
2009-12-16 13:00:37 +00:00
Andriy Gapon
ac2703ea39 ichsmb: add another pci id
This is SMBus controller found in Intel Platform Controller Hub (PCH),
which is a general name that refers to Intel 5 Series chipsets and
3400 Series chipsets.

Submitted by:	Dmitry S. Luhtionov <mitya@cabletv.dp.ua>
MFC after:	3 days
2009-12-16 12:25:27 +00:00
Luigi Rizzo
97219abf05 Various cosmetic cleanup of the files:
- move global variables around to reduce the scope and make them
  static if possible;
- add an ipfw_ prefix to all public functions to prevent conflicts
  (the same should be done for variables);
- try to pack variable declaration in an uniform way across files;
- clarify some comments;
- remove some misspelling of names (#define V_foo VNET(bar)) that
  slipped in due to cut&paste
- remove duplicate static variables in different files;

MFC after:	1 month
2009-12-16 10:48:40 +00:00
Warner Losh
26bbc1fc5a Quick fix to make this compile:
Remove redundant extern declearations.
If the maintainer has a better fix, then feel free to back this out.
2009-12-16 03:26:37 +00:00
Doug Barton
f1bdf073c1 Add INCLUDE_CONFIG_FILE, and a note in comments about how to also
include the comments with CONFIGARGS
2009-12-16 02:17:43 +00:00
Warner Losh
c643f1e35d Remove the now-obsolete comments about compile-with. There are no
compile-with lines in this file at all.  So we don't need two warnings
about them.
2009-12-15 23:22:19 +00:00
Jung-uk Kim
3afa8e569e Add two new debugging tunables for x86bios instead of abusing bootverbose,
i.e., debug.x86bios.call and debug.x86bios.int.
2009-12-15 22:44:28 +00:00
Luigi Rizzo
22f123afad more splitting of ip_fw2.c, now extract the 'table' routines
and the sockopt routines (the upper half of the kernel).

Whoever is the author of the 'table' code (Ruslan/glebius/oleg ?)
please change the attribution in ip_fw_table.c. I have copied
the copyright line from ip_fw2.c but it carries my name and I have
neither written nor designed the feature so I don't deserve
the credit.

MFC after:	1 month
2009-12-15 21:24:12 +00:00
Jung-uk Kim
1ce5efd4b6 Attach dpms(4) to vgapm and make sure to restore DPMS state after
VGA is resumed properly.

Reviewed by:	jhb
2009-12-15 19:58:23 +00:00
Luigi Rizzo
5f2e16424c add ip_fw_private.h to ng_ipfw.c, forgotten in previous commit;
comment out remove ip_fw.h from ng_bridge.c, as it seems unused.

MFC after:	1 month
2009-12-15 18:33:12 +00:00
Luigi Rizzo
70228fb346 Start splitting ip_fw2.c and ip_fw.h into smaller components.
At this time we pull out from ip_fw2.c the logging functions, and
support for dynamic rules, and move kernel-only stuff into
netinet/ipfw/ip_fw_private.h

No ABI change involved in this commit, unless I made some mistake.
ip_fw.h has changed, though not in the userland-visible part.

Files touched by this commit:

conf/files
	now references the two new source files

netinet/ip_fw.h
	remove kernel-only definitions gone into netinet/ipfw/ip_fw_private.h.

netinet/ipfw/ip_fw_private.h
	new file with kernel-specific ipfw definitions

netinet/ipfw/ip_fw_log.c
	ipfw_log and related functions

netinet/ipfw/ip_fw_dynamic.c
	code related to dynamic rules

netinet/ipfw/ip_fw2.c
	removed the pieces that goes in the new files

netinet/ipfw/ip_fw_nat.c
	minor rearrangement to remove LOOKUP_NAT from the
	main headers. This require a new function pointer.

A bunch of other kernel files that included netinet/ip_fw.h now
require netinet/ipfw/ip_fw_private.h as well.
Not 100% sure i caught all of them.

MFC after:	1 month
2009-12-15 16:15:14 +00:00
Bruce M Simpson
977ff62485 Add missing #include <sys/ktr.h>.
Submitted by:	Hideki Yamamoto
MFC after:	1 week
2009-12-15 10:40:40 +00:00
Luigi Rizzo
472099c4b0 implement a new match option,
lookup {dst-ip|src-ip|dst-port|src-port|uid|jail} N

which searches the specified field in table N and sets tablearg
accordingly.
With dst-ip or src-ip the option replicates two existing options.
When used with other arguments, the option can be useful to
quickly dispatch traffic based on other fields.

Work supported by the Onelab project.

MFC after:	1 week
2009-12-15 09:46:27 +00:00
Warner Losh
eb1b8eeafe Should have been copied frmo OCTEON.hints, but I botched that, so
we're stuck with this.  Given that this branch will soon be merged and
retired, I don't think it matters much.
2009-12-15 00:44:33 +00:00
Pyun YongHyeon
0c003e99df 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().
2009-12-14 22:55:20 +00:00
Rui Paulo
37c90cfec7 Add apple-boot and apple-ufs.
Submitted by:	nwhitehorn
2009-12-14 22:47:09 +00:00
Pyun YongHyeon
5f26dcd859 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.
2009-12-14 22:30:07 +00:00
Jung-uk Kim
871d21ce2d Remove _FDE quirk handling as these quirks are automatically repaired
by ACPICA layer since ACPICA 20091214.
2009-12-14 22:28:32 +00:00
Jung-uk Kim
572c8255e6 Merge ACPICA 20091214. 2009-12-14 22:24:04 +00:00
Pyun YongHyeon
6f53098372 Report media change result to caller instead of returning success
without regard to the result.
2009-12-14 22:23:06 +00:00
Pyun YongHyeon
e7b2d9b80f 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().
2009-12-14 22:20:05 +00:00
Pyun YongHyeon
e4027c4968 Sort function prototyes. 2009-12-14 22:00:11 +00:00
Pyun YongHyeon
20c3cb15df 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().
2009-12-14 21:16:02 +00:00
Marius Strobl
e29c870781 Set ATA_CHECKS_CABLE when appropriate.
Reviewed by:	mav
MFC after:	1 week
2009-12-14 21:11:50 +00:00
Pyun YongHyeon
623fa7184b Increase output queue size from 64 to 255. 2009-12-14 20:59:18 +00:00
Pyun YongHyeon
5957cc2a24 Add MSI support for VT613x controllers. 2009-12-14 20:49:50 +00:00
Pyun YongHyeon
643e9ee9fb 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.
2009-12-14 20:39:42 +00:00
Rui Paulo
33f7a4124d Add Microsoft and NetBSD partition types handling. 2009-12-14 20:26:27 +00:00
Pyun YongHyeon
4d7235dd49 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.
2009-12-14 20:17:53 +00:00
Luigi Rizzo
614cb83990 Move the scan for max_keylen into route.c::route_init(),
and make max_keylen an argument for rn_init().
This removes an unnecessary dependency on domain.h from radix.c

MFC after:	7 days
2009-12-14 20:12:51 +00:00
Pyun YongHyeon
77ec83ced8 style(9). 2009-12-14 20:07:25 +00:00
Rui Paulo
ee085c333e Add more Apple partition types. 2009-12-14 20:04:28 +00:00
Rui Paulo
f13174303d Simplify partition type parsing by using a data-oriented model.
While there add more Apple and Linux partition types.
2009-12-14 20:04:06 +00:00
Pyun YongHyeon
c3c74c6107 s/u_intXX_t/uintXX_t/g 2009-12-14 19:53:57 +00:00
Pyun YongHyeon
e44b7069a9 Remove unnecessary return statement. 2009-12-14 19:49:20 +00:00
Pyun YongHyeon
6afe22a8e6 Use ANSI function definations. 2009-12-14 19:44:54 +00:00
Gavin Atkinson
4e7ebd34ef Don't panic on failure to attach if we fail before or during the
if_alloc() of ifp.  This fixes the panic reported in the PR, but
not the attach failure.

PR:		kern/139079
Tested by:      Steven Noonan <steven uplinklabs.net>
Reviewed by:	thompsa
Approved by:	ed (mentor)
MFC after:	2 weeks`
2009-12-14 19:18:02 +00:00
Pyun YongHyeon
420d0abff8 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.
2009-12-14 19:08:11 +00:00
Jack F Vogel
74dbc418c7 Add old read_mac_addr routine to this module since
a customer report of an Invalid MAC Address has occurred.
2009-12-14 19:05:16 +00:00
Pyun YongHyeon
bf93bee5c5 Fix typo in register definition. 2009-12-14 18:50:26 +00:00
Pyun YongHyeon
4baee89724 Use PCIR_BAR instead of hard-coded value. 2009-12-14 18:49:16 +00:00
Pyun YongHyeon
410f4c60ad 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.

Tested by:	Dewayne Geraghty (dewayne.geraghty <> heuristicsystems dot com dot au)
		Carey Jones (m.carey.jones <> gmail dot com)
		Yoshiaki Kasahara (kasahara <> nc dor kyushu-u dot ac dotjp)
2009-12-14 18:44:23 +00:00
Rui Paulo
2d7340428b Pass all IEs to net80211.
PR:		141376
Submitted by:	Paul <onemda at gmail.com>
MFC after:	1 week
2009-12-14 18:43:27 +00:00
Jack F Vogel
92cc9dde8b Remove the MTX_SPIN flag to the shared code MUTEX
as it was causing a panic, also took the opportunity
to rename the lock for clarity.
2009-12-14 18:43:18 +00:00
Pyun YongHyeon
8b3433dc98 Prefer bus_alloc_resource_any(9) to bus_alloc_resource(9). 2009-12-14 18:27:34 +00:00
Pyun YongHyeon
8170b2431e Fix spelling in comment. 2009-12-14 18:19:56 +00:00
Pyun YongHyeon
481402e197 Prefer device_printf(9) to printf(9). 2009-12-14 18:00:08 +00:00
Pyun YongHyeon
b534dcd5c0 Remove register keyword. 2009-12-14 17:53:10 +00:00
John Baldwin
36f1a2c073 Remove comment claiming that building acpi into the kernel is deprecated.
PR:		docs/141353
Submitted by:	Bruce Cran
MFC after:	1 week
2009-12-14 15:32:32 +00:00
Luigi Rizzo
20c510f826 Properly fix callout handling by putting all the per-cpu info in
struct callout_cpu. From the comment in the file:

+ * There is one struct callout_cpu per cpu, holding all relevant
+ * state for the callout processing thread on the individual CPU.
+ * In particular:
+ *     cc_ticks is incremented once per tick in callout_cpu().
+ *     It tracks the global 'ticks' but in a way that the individual
+ *     threads should not worry about races in the order in which
+ *     hardclock() and hardclock_cpu() run on the various CPUs.
+ *     cc_softclock is advanced in callout_cpu() to point to the
+ *     first entry in cc_callwheel that may need handling. In turn,
+ *     a softclock() is scheduled so it can serve the various entries i
+ *     such that cc_softclock <= i <= cc_ticks .

Together with a smaller patch committed in september, this fixes a
bug that affects 8.0 with apps that rely on callouts to fire exactly
in the number of ticks specified (qemu among them).
Right now, callouts in 8.0 fire one tick late.

This was discussed in september with JeffR and jhb

MFC after:	3 days
2009-12-14 12:23:46 +00:00
Marius Strobl
74f5b28a4d Only set ATA_CHECKS_CABLE for chip versions that actually support
cable detection, i.e. neither for ALI_OLD nor for ALI_NEW revisions
>= 0xc7.

MFC after:	1 week
2009-12-13 20:36:42 +00:00
Bjoern A. Zeeb
07f5a2c997 Make admsw(4) compile again fixing typos and adding the missing variable
after r199762.
2009-12-13 20:27:59 +00:00
Marius Strobl
affcd29e6a Properly support M5229 revision 0xc7 and 0xc8:
- These revisions no longer have cable detection capability.
- The UDMA support bit of register 0x4b has been dropped without an
  replacement.
- According to Linux it's crucial for working ATAPI DMA support to
  also set the reserved bit 1 of regsiter 0x53 with these revisions.

MFC after:	1 week
2009-12-13 18:42:06 +00:00
Marius Strobl
4640fdb5b6 Specify the capability and media bits of the capabilities page in
native, i.e. big-endian, format and convert as appropriate like we
also do with the multibyte fields of the other pages. This fixes
the output of acd_describe() to match reality on big-endian machines
without breaking it on little-endian ones. While at it, also convert
the remaining multibyte fields of the pages read although they are
currently unused for consistency and in order to prevent possible
similar bugs in the future.

MFC after:	1 week
2009-12-13 18:26:19 +00:00
Bjoern A. Zeeb
de0bd6f76b Throughout the network stack we have a few places of
if (jailed(cred))
left.  If you are running with a vnet (virtual network stack) those will
return true and defer you to classic IP-jails handling and thus things
will be "denied" or returned with an error.

Work around this problem by introducing another "jailed()" function,
jailed_without_vnet(), that also takes vnets into account, and permits
the calls, should the jail from the given cred have its own virtual
network stack.

We cannot change the classic jailed() call to do that,  as it is used
outside the network stack as well.

Discussed with:	julian, zec, jamie, rwatson (back in Sept)
MFC after:	5 days
2009-12-13 13:57:32 +00:00
Bjoern A. Zeeb
e65a4ba18b Add a few more V_hacks to nfsclient to allow machines with a VIMAGE
kernel to boot from NFS. [1]

Note: this is not a full virtualization of nfsclient. It is only does
what advertised above and nothing more.

Requested by:	public demand [1]
Tested by:	kris, ..
MFC after:	5 days
2009-12-13 11:06:39 +00:00
Marcel Moolenaar
066b1a5c7b Add support for memory disk (md). The size of the memory disk
is determined by MD_IMAGE_SIZE. A file system can be embedded
into the loader with /sys/tools/embed_mfs.sh.
Note that md.c is not included when MD_IMAGE_SIZE is not set.
2009-12-13 01:20:32 +00:00
Marius Strobl
0966baf709 Unbreak the ata_atapi() usage. Since r200171 the mode setting functions
get a ata_device type device passed instead of a ata_channel one, thus
ata_atapi() has to be adjusted accordingly.

Reviewed by:	mav
MFC after:	3 days
2009-12-13 00:13:21 +00:00
Attilio Rao
2028867def In current code, threads performing an interruptible sleep (on both
sxlock, via the sx_{s, x}lock_sig() interface, or plain lockmgr), will
leave the waiters flag on forcing the owner to do a wakeup even when if
the waiter queue is empty.
That operation may lead to a deadlock in the case of doing a fake wakeup
on the "preferred" (based on the wakeup algorithm) 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.  In this case, even if the waiters queue
is not empty, the waiters won't progress after being awake but they will
just fail, still not taking care of the 2nd queue waiters (as instead the
lock owned doing the wakeup would expect).

In order to fix this bug in a cheap way (without adding too much locking
and complicating too much the semantic) add a sleepqueue interface which
does report the actual number of waiters on a specified queue of a
waitchannel (sleepq_sleepcnt()) and use it in order to determine if the
exclusive waiters (or shared waiters) are actually present on the lockmgr
(or sx) before to give them precedence in the wakeup algorithm.
This fix alone, however doesn't solve the LK_SLEEPFAIL bug. In order to
cope with it, add the tracking of how many exclusive LK_SLEEPFAIL waiters
a lockmgr has and if all the waiters on the exclusive waiters queue are
LK_SLEEPFAIL just wake both queues.

The sleepq_sleepcnt() introduction and ABI breakage require
__FreeBSD_version bumping.

Reported by:	avg, kib, pho
Reviewed by:	kib
Tested by:	pho
2009-12-12 21:31:07 +00:00
Konstantin Belousov
1173b9a2d0 For ia32 syscall(), call cpu_set_syscall_retval(). Update comment inside
cpu_set_syscall_retval() accordingly.

MFC after:	1 week
2009-12-12 20:11:31 +00:00
Luigi Rizzo
a50f6188de Make the code buildable in userland so it is easier to test it:
this requires a small reordering of headers and a few #defines to
map functions not available in userland.

Remove a useless #ifndef block at the beginning of the file.

Introduce (temporarily) rn_init2(), see the comment in the code
for the proper long term change.

No ABI or functional change.

MFC after:	7 days
2009-12-12 15:49:28 +00:00
Pyun YongHyeon
f52384d1cf 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.
2009-12-12 00:06:43 +00:00
Alexander Motin
c2023eeaad CFA support doesn't exclude FLUSH support.
Submitted by:	Grzegorz Bernacki
2009-12-11 16:32:59 +00:00
Yoshihiro Takahashi
36ff75683a Cleanups the boot2 for pc98. There is no functional change.
- Make setting machine type and getting geom conditional for future.
  - Remove unused RAWBOOT and CDBOOT supports.
  - Remove unneeded include.
  - Fix warnings.

MFC after:	1 week
2009-12-11 12:36:59 +00:00
Luigi Rizzo
37e20d0a37 only export bio_cmd and flags to userland (bio_cmd are
used by ggatectl, flags are potentially useful).
Other parts are internal kernel data structures and should
not be visible to userland.

No API change involved.

MFC after:	3 days
2009-12-11 10:35:58 +00:00
Marcel Moolenaar
57467e5933 Fix interrupt handling. It started off broken and grew worse over time.
The rewrite of the interrupt handler includes:
o   loop until all pending interrupts are handled. This closes a
    race condition.
o   count the number of interrupt sources we handled so that we can
    properly return FILTER_HANDLED or FILTER_STRAY when we break out
    of the loop.
o   When matching the interrupt source to the devices that have that
    source pending, check only from the set of devices we found to
    have a pending interrupt.

PR:		kern/140947
MFC after:	3 days
2009-12-11 03:08:07 +00:00
Andrew Thompson
ae6de8d67a Wrap long lines. 2009-12-11 02:52:14 +00:00
Andrew Thompson
4b5437a114 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-11 02:44:15 +00:00
Andrew Thompson
84d250f195 Revert r199331, the UM175 is in fact a cdc-acm device handled by umodem(4). 2009-12-11 00:57:30 +00:00
Alexander Motin
1969c3f4ea Add one more set of codec IDs. 2009-12-11 00:38:13 +00:00
Luigi Rizzo
b2089673e5 use div64 when converting back the burst value for userland 2009-12-10 18:37:14 +00:00
Luigi Rizzo
89717f91ef when draining a flowset free the entire chain, not just one packet. 2009-12-10 18:34:07 +00:00
Takanori Watanabe
28336d6080 Add module dependency for cam if configured as ATA_CAM. 2009-12-10 16:55:16 +00:00
Luigi Rizzo
478cae8a97 centralize the code to free a packet (or a chain) while in dummynet.
Remove an old macro and its stale comment.
2009-12-10 15:17:34 +00:00
John Baldwin
e85b664cd2 Don't warn about an RSDP with a corrupt checksum. The kernel does a better
job about warning about these things later and this message can be
confusing.

Submitted by:	infofarmer
MFC after:	1 week
2009-12-10 14:54:29 +00:00
Luigi Rizzo
22efc80fd8 No functional changes (who dares to touch this code!) but:
- cast the result of LEN() to int as this is the main usage.
- use LEN() in one place where it was forgotten.
- Document the use of a static variable in rw mode.

More small changes to follow.

MFC after:	7 days
2009-12-10 10:34:30 +00:00
Alexander Motin
7f719ba784 Limit maximum I/O size, depending on command set supported by device.
It is required to suppot non-LBA48 devices with MAXPHYS above 128K.
Same is done in ada(4).
2009-12-10 09:26:56 +00:00
Kip Macy
126e2c082b for PV XEN translate page table entries from machine (real) to physical (logical) addresses so that kgdb can
translate them to the correct coredump offsets
2009-12-10 07:48:47 +00:00
Kip Macy
72bc4ff74d - revert pmap_kenter_temporary to taking a physical address
- make minidump work
2009-12-10 03:09:35 +00:00
Warner Losh
912012d34a Hook up parsing of the boot records. 2009-12-10 01:45:06 +00:00
Warner Losh
41d3506b15 Get the sense of this right. We use uintpr_t for bus_addr_t when
we're building everything except octeon && 32-bit.  As note before, we
need a clearner way, but at least now the hack is right.
2009-12-10 01:44:11 +00:00
Warner Losh
e6e7f898dd app_descriptor_addr is unused (I know it is referened still). And
unnecessary since we pass in a3 unmodified to platform_start.
Eliminate it from here and kill one more TARGET_OCTEON in the process.
2009-12-10 01:42:44 +00:00
Jung-uk Kim
e36af2929a Implement a rudimentary suspend/resume methods for PCI P2P bridge.
Reviewed by:	jhb, imp
2009-12-10 01:01:53 +00:00
John Baldwin
42a346fa63 For some buses, devices may have active resources assigned even though they
are not allocated by the device driver.  These resources should still appear
allocated from the system's perspective so that their assigned ranges are
not reused by other resource requests.  The PCI bus driver has used a hack
to effect this for a while now where it uses rman_set_device() to assign
devices to the PCI bus when they are first encountered and later assigns
them to the actual device when a driver allocates a BAR.  A few downsides of
this approach is that it results in somewhat confusing devinfo -r output as
well as not being very easily portable to other bus drivers.

This commit adds generic support for "reserved" resources to the resource
list API used by many bus drivers to manage the resources of child devices.
A resource may be reserved via resource_list_reserve().  This will allocate
the resource from the bus' parent without activating it.
resource_list_alloc() recognizes an attempt to allocate a reserved resource.
When this happens it activates the resource (if requested) and then returns
the reserved resource.  Similarly, when a reserved resource is released via
resource_list_release(), it is deactivated (if it is active) and the
resource is then marked reserved again, but is left allocated from the
bus' parent.  To completely remove a reserved resource, a bus driver may
use resource_list_unreserve().  A bus driver may use resource_list_busy()
to determine if a reserved resource is allocated by a child device or if
it can be unreserved.

The PCI bus driver has been changed to use this framework instead of
abusing rman_set_device() to keep track of reserved vs allocated resources.

Submitted by:	imp (an older version many moons ago)
MFC after:	1 month
2009-12-09 21:52:53 +00:00
John Baldwin
23e00c4d81 Fix a confusing typo in the EDD packet structure used in gptboot and
gptzfsboot.  I got the segment and offset fields reversed in the structure,
but I also succeeded in crossing the assignments so the actual EDD packet
ended up correct.

MFC after:	1 week
2009-12-09 21:09:32 +00:00
John Baldwin
4497287f20 - Port bios_getmem() from libi386 to {gpt,}zfsboot() and use it to
safely allocate a heap region above 1MB.  This enables {gpt,}zfsboot()
  to allocate much larger buffers than before.
- Use a larger buffer (1MB instead of 128K) for temporary ZFS buffers.  This
  allows more reliable reading of compressed files in a raidz/raidz2 pool.

Submitted by:	Matt Reimer  mattjreimer of gmail
MFC after:	1 week
2009-12-09 20:36:56 +00:00
Andrew Thompson
4a0bce1923 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-09 20:28:33 +00:00
Andrew Thompson
85e3d588a5 Fix dwSignature for NCM mode and add extra debug output.
Submitted by:	HPS
2009-12-09 20:27:06 +00:00
Andrew Thompson
27148a6c72 Add new device ids.
PR:		usb/140951, usb/140923
Submitted by:	Romain Tartiere, Brett Glass
2009-12-09 20:24:49 +00:00
Andrew Thompson
741194f111 Correct name, 82801IJ -> 82801JI
Submitted by:	mitya_cabletv.dp.ua
2009-12-09 20:17:22 +00:00
Andrew Thompson
0ca80d71d0 If the ID byte is non zero then we allow descriptors having multiple sizes.
Submitted by:	HPS
Reported by:	daichi
2009-12-09 20:15:05 +00:00
Alexander Motin
2ec0f2e186 Clear result before requesting XPT_PATH_INQ.
Many SIMs doesn't fill maxio field yet.
2009-12-09 14:21:21 +00:00
Alexander Motin
1535d59d7c Increase Max Read Request Size for PCIe chips from 512 to 1024 bytes.
It gives those beasts additional 10% of write bandwidth.
2009-12-09 13:10:10 +00:00
Kip Macy
367bfeea1c make PV core dump actually dump memory - still need to fix program header initialization 2009-12-09 08:09:25 +00:00
Xin LI
d9cf8753e3 Allow using IPv6 in nfsrvd_sentcache() callback.
PR:		kern/141289
Submitted by:	Petr Lampa <lampa fit vutbr cz>
Approved by:	rmacklem
MFC after:	1 week
2009-12-08 23:43:50 +00:00
Jung-uk Kim
93eba8807c Simplify a macro not to generate unncessary symbols. 2009-12-08 22:38:42 +00:00
Alexander Motin
402ea18cbd Fix the build. 2009-12-08 21:42:04 +00:00
Edward Tomasz Napierala
9d7031a6d6 Don't add VAPPEND if the file is not being opened for writing. Note that this
only affects cases where open(2) is being used improperly - i.e. when the user
specifies O_APPEND without O_WRONLY or O_RDWR.

Reviewed by:	rwatson
2009-12-08 20:47:10 +00:00
Marius Strobl
259100de20 Add additional checks of the kernel stack addresses in order to
ensure we don't overrun the end of the call chain.

MFC after:	1 week
2009-12-08 20:18:54 +00:00
Jack F Vogel
2b8dbb8253 Remove phantom line of code that somehow slipped
into the checkin.
2009-12-08 18:54:37 +00:00
Pyun YongHyeon
beaa2ae169 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.

Reviewed by:	bde (initial version)
2009-12-08 17:54:23 +00:00
Alexander Motin
7b4386c655 Add ID for NetMos NM9820 Serial Port chip, found on CardBus serial adapter. 2009-12-08 14:55:07 +00:00
Yoshihiro Takahashi
1a800d321e MFi386: revision 200219
Improve the algorithm the loader uses to choose a memory range for its
  heap when using a range above 1MB.

MFC after:	1 week
2009-12-08 13:06:35 +00:00
Yoshihiro Takahashi
ff85a22cfd MFi386: Use real mode instead of v86 mode.
MFC after:	1 week
2009-12-08 13:04:26 +00:00
Yoshihiro Takahashi
e61de1d24c MFi386: revision 200216
Various small whitespace and style fixes.
2009-12-08 12:10:06 +00:00
Jung-uk Kim
23e876b121 - 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.

PR:		kern/141269
Submitted by:	Alexander Sack (asack at niksun dot com)[1]
Reviewed by:	scottl
2009-12-08 05:35:51 +00:00
Pyun YongHyeon
9766cbd144 Partially revert r200228. For mini RCB case, bge(4) still have to
disable mini ring withtout regard to mini ring support.

Reported by:	marcel
Tested by:	marcel
2009-12-08 03:24:29 +00:00
Jack F Vogel
4edd8523d4 Resync with Intel versions of both the em and igb
drivers. These add new hardware support, most importantly
the pch (i5 chipset) in the em driver. Also, both drivers
now have the simplified (and I hope improved) watchdog
code. The igb driver uses the new RX cleanup that I
first implemented in ixgbe.

em  - version 6.9.24
igb - version 1.8.4
2009-12-08 01:07:44 +00:00
Rui Paulo
f59310a164 Fix typo in comment
Submitted by:	Paul B Mahol <onemda at gmail.com>
2009-12-08 00:54:08 +00:00
Rui Paulo
64e5a27754 Improve response to multi-touch taps.
Submitted by:	Rohit Grover <rgrover1 at gmail.com>
2009-12-08 00:52:59 +00:00
Marcel Moolenaar
c4dbd41f5d In exception_save, write-back ar.rnat after switching the backing-
store. Writing to ar.bspstore is defined to leave ar.rnat undefined.

PR:		ia64/120315
MFC after:	3 days
2009-12-08 00:44:23 +00:00
Jack F Vogel
2969bf0e46 Update driver to Intel version 2.0.7:
This adds new feature support for the 82599, a hardware
assist to LRO, doing this required a large revamp to the
RX cleanup code because the descriptor ring may not be
processed out of order, this necessitated the elimination
of global pointers.

Additionally, the RX routine now does not refresh mbufs
on every descriptor, rather it will do a range, and then
update the hardware pointer at that time. These are
performance oriented changes.

The TX side now has a cleaner simpler watchdog algorithm
as well, in TX cleanup a read of ticks is stored, that
can then be compared in local_timer to determine if
there is a hang.

Various other cleanups along the way, thanks to all who
have provided input and testing.
2009-12-07 21:30:54 +00:00
Jung-uk Kim
406930fba4 Revert r200231. It was already taken cared by jhb long ago.
Pointed out by:	jhb
Pointy hat:	jkim
2009-12-07 21:24:07 +00:00
Jung-uk Kim
0cca89cc53 Make mfi(4) little bit less chatty. 2009-12-07 20:17:33 +00:00
Marcel Moolenaar
1d864e0d2d Add support for the NetMos NM9865 family of Serial/Parallel ports.
Obtained from:	NetMos MCS9865 v1.0.0.1 driver
MFC after:	3 days
2009-12-07 20:05:02 +00:00
Pyun YongHyeon
2a141b9412 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.

Reviewed by:	marius
2009-12-07 19:26:54 +00:00
Pyun YongHyeon
6fe124d275 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.

Reviewed by:	marius
2009-12-07 19:18:23 +00:00
Alexander Motin
3005368137 Explicitly acknowledge MSI completion, as required by SiI3124 datasheet.
It makes MSI working there. Later (and cheaper) PCIe chips (3132/3531)
still randomly crashing system in few seconds of high MSI rates, generating
something inaporopriate, like NMI or "Fatal trap 30".
2009-12-07 18:37:50 +00:00
John Baldwin
f1a6fd5d07 Improve the algorithm the loader uses to choose a memory range for its
heap when using a range above 1MB.

Previously the loader would always use the last 3MB in the first memory
range above 1MB for the heap.  However, this memory range is also where the
kernel and any modules are loaded.  If this memory range is "small", then
using the high 3MB for the heap may not leave enough room for the kernel
and modules.

Now the loader will use any range below 4GB for the heap, and the logic to
choose the "high" heap region has moved into biosmem.c.  It sets two
variables that the loader can use for a high heap if it desires.  When a
high heap is enabled (BZIP2, FireWire, GPT, or ZFS), then the following
memory ranges are preferred for the heap in order from best to worst:
- The largest memory region in the SMAP with a start address greater than
  1MB.  The memory region must be at least 3MB in length.  This leaves the
  region starting at 1MB purely for use by the kernel and modules.
- The last 3MB of the memory region starting at 1MB if it is at least 3MB
  in size.  This matches the current behavior except that the current loader
  would break horribly if the first region was not at least 3MB in size.
- The memory range from the end of the loader up to the 640k window.  This
  is the range the loader uses when none of the high-heap-requesting options
  are enabled.

Tested by:	hrs
MFC after:	1 week
2009-12-07 16:29:43 +00:00
Alexander Motin
7bdb664e50 MFp4;
- Cleanup kernel messages, mostly PMP.
- Took references on devices, while PMP reinitializes them, to not let them
go and distort freeze reference counting.
2009-12-07 16:23:25 +00:00
Alexander Motin
d095fa045c SiI3124 has no SNotification register. Handle Asynchronous Notifications
there without it as good as possible.
2009-12-07 16:10:48 +00:00
John Baldwin
eddb3f5b88 Various small whitespace and style fixes. 2009-12-07 16:00:59 +00:00
Marius Strobl
22bf171313 Add <machine/pcb.h> missed in r199135. 2009-12-07 15:29:07 +00:00
Guido van Rooij
c53a28102a Fix ntfs such that it understand media with a non-512-bytes sector size:
1. Fixups are always done on 512 byte chunks (in stead of sectors). This
is kind of stupid.
2. Conevrt between NTFS blocknumbers (the blocksize equals the media
sector size) and the bread() and getblk() blocknr (which are 512-byte
sized)

NB: this change should not affect ntfs for 512-byte sector sizes.
2009-12-07 15:15:08 +00:00
Marcel Moolenaar
58a0206d63 Define struct pcpu_md as the only MD field of struct pcpu (pc_acpi_id
excluded, as it's used by MI code) and mode the sysctl variables from
pcpu_stats to pcpu_md.
Adjust all references accordingly.

While nearby, change the PCPU sysctl tree so that they match the CPU
device sysctl tree -- they are now children of a static node called
"machdep.cpu" and are named only with their cpu ID.
2009-12-07 06:41:27 +00:00
Marcel Moolenaar
4dbb79b42d Allocate the VHPT for each CPU in cpu_mp_start(), rather than
allocating MAXCPU VHPTs up-front. This allows us to max-out MAXCPU
without memory waste -- MAXCPU is now 32 for SMP kernels.

This change also eliminates the VHPT scaling based in the total
memory in the system. It's the workload that determines the best size
of the VHPT. The workload can be affected by the amount of memory,
but not necessarily. For example, there's no performance difference
between VHPT sizes of 256KB, 512KB and 1MB when building the LINT
kernel. This was observed with a system that has 8GB of memory.
By default the kernel will allocate a 1MB VHPT. The user can tune the
system with the "machdep.vhpt.log2size" tunable.
2009-12-07 00:54:02 +00:00
Alexander Motin
a48eed8352 Add Asynchronous Notification support for controllers without SNTF
capability by snooping SDB FIS receive area. It should be even faster
then regular way, but less reliable.
2009-12-06 23:56:54 +00:00
Ed Schouten
04b0c5bbfa Add a libutempter compatibility interface to libulog.
The ulog_login_pseudo(3) and ulog_logout_pseudo(3) interfaces provide a
functionality identical to what libutempter has to offer. Just transform
libutempter's calls into the before mentioned functions.

libutempter doesn't work with utmpx, so instead of fixing I thought the
easiest way would be to integrate this functionality. libutempter is
used by applications like xterm and the KDE libraries, so if I ever
change the underlying file format, these applications will keep working
automatically.

Also increase __FreeBSD_version to indicate the addition (as well as the
import of libulog).
2009-12-06 20:30:21 +00:00
Nathan Whitehorn
edbb090444 Unbreak build.
Pointy hat to: me
2009-12-06 17:26:43 +00:00
Alexander Motin
21cc85878c MFp4:
If we panicked with SIM lock held, do not try to flush caches.
Extra lock recursing will not make debugging easier.
2009-12-06 11:48:53 +00:00
Alexander Motin
066f913a94 MFp4:
Introduce ATA_CAM kernel option, turning ata(4) controller drivers into
cam(4) interface modules. When enabled, this options deprecates all ata(4)
peripheral drivers (ad, acd, ...) and interfaces and allows cam(4) drivers
(ada, cd, ...) and interfaces to be natively used instead.

As side effect of this, ata(4) mode setting code was completely rewritten
to make controller API more strict and permit above change. While doing
this, SATA revision was separated from PATA mode. It allows DMA-incapable
SATA devices to operate and makes hw.ata.atapi_dma tunable work again.

Also allow ata(4) controller drivers (except some specific or broken ones)
to handle larger data transfers. Previous constraint of 64K was artificial
and is not really required by PCI ATA BM specification or hardware.

Submitted by:	nwitehorn (powerpc part)
2009-12-06 00:10:13 +00:00
Oleg Bulyzhin
22746035ec Fix burst processing for WF2Q pipes - do not increase available burst size
unless pipe is idle. This should fix follwing issues:
- 'dummynet: OUCH! pipe should have been idle!' log messages.
- exceeding configured pipe bandwidth.

MFC after:	1 week
2009-12-05 23:27:21 +00:00
Konstantin Belousov
88f2d72947 Change VOP_FSYNC for zfs vnode from VOP_PANIC to zfs_freebsd_fsync(),
both to not panic when fsync(2) is called for fifo on zfs
filedescriptor, and to actually fsync fifo inode to permanent storage.

PR:	kern/141177
Reviewed by:	pjd
MFC after:	1 week
2009-12-05 20:36:42 +00:00
Pawel Jakub Dawidek
dfb903e852 We have to eventually look for provider without checking guid as this is need
for attaching when there is no metadata yet.

Before r200125 the order of looking for providers was wrong. It was:
1. Find provider by name.
2. Find provider by guid.
3. Find provider by name and guid.

Where it should have been:
1. Find provider by name and guid.
2. Find provider by guid.
3. Find provider by name.

MFC after:	1 week
2009-12-05 20:16:28 +00:00
Antoine Brodin
4e2d83fc4a Remove trailing ";" in UMA_HASH_INSERT and UMA_HASH_REMOVE macros.
MFC after:	1 month
2009-12-05 17:45:56 +00:00
Pawel Jakub Dawidek
6468cb2ce0 Fix deadlock when ZVOLs are present and we are replacing dead component or
calling scrub when pool is in a degraded state. It will try to taste ZVOLs,
which will lead to deadlock, as ZVOL will try to acquire the same locks as
replace/scrub is holding already.

We can't simply skip provider based on their GEOM class, because ZVOL can have
providers build on top of it and we need to skip those as well.

We do it by asking for ZFS::iszvol attribute. Any ZVOL-based provider will give
us positive answer and we have to skip those providers.

This way we remove possibility to create ZFS pools on top of ZVOLs, but it is
not very useful anyway.

I believe deadlock is still possible in some very complex situations like when
we have MD provider on top of UFS file on top of ZVOL. When we try to replace
dead component in the pool mentioned ZVOL is based on, there might be a
deadlock when ZFS will try to taste MD provider. There is no easy way to detect
that, but it isn't very common.

MFC after:	1 week
2009-12-05 14:33:11 +00:00
Pawel Jakub Dawidek
ccba826977 Always check guid when opening by path, because we may end up with provider
that does have the same name, but only by accident.

MFC after:	1 week
2009-12-05 14:24:22 +00:00
Pawel Jakub Dawidek
29c8c85594 Avoid using additional variable for storing an error if we are not going
to do anything with it.
2009-12-05 14:21:42 +00:00
Alexander Motin
ff09f97fb4 Do not ignore device interrupt if bus mastering is still active. It is
normal in case of media read error and some ATAPI cases, when transfer size
is unknown beforehand. PCI ATA BM specification tells that in case of such
underrun driver should just manually stop DMA engine. DMA engine should
same time guarantie that all bus mastering transfers completed at the moment
of driver reads interrupt flag asserted.
This change should fix interrupt storms and command timeouts in many cases.

PR:		kern/103602, sparc64/121539, kern/133122, kern/139654
2009-12-05 13:40:51 +00:00
Luigi Rizzo
f573a0a634 adjust comment in previous commit after Julian's explanation 2009-12-05 11:51:32 +00:00
Alexander Motin
00f0143052 On Soft Reset, read device signature from FIS receive area, instead of
PxSIG register. It works better for NVidia chipsets. ahci(4) does the same.

PR:		kern/140472, i386/138668
2009-12-05 10:30:54 +00:00
Luigi Rizzo
bc0d5982e2 remove a dead block of code, document how the ipfw clients are
hooked and the difference in handling the 'enable' variable
for layer2 and layer3. The latter needs fixing once i figure out
how it worked pre-vnet.

MFC after:	7 days
2009-12-05 09:13:06 +00:00
Luigi Rizzo
e99816f1eb fix build with VNET enabled
Reported by: David Wolfskill
2009-12-05 08:32:12 +00:00
Konstantin Belousov
9afcc9986c Regenerate. 2009-12-04 21:53:20 +00:00
Konstantin Belousov
195edf8a5a Add several syscall compat32 entries for acl manipulation.
They do not require translation of the arguments.

Tested by:	bsam
MFC after:	1 week
2009-12-04 21:52:31 +00:00
Alexander Leidinger
7b6bedd3a7 This is v4l support for the linuxulator. This allows to access FreeBSD
native devices which support the v4l API from processes running within
the linuxulator, e.g. skype or flash can access the multimedia/pwcbsd driver.

Not tested is firmware upload, framebuffer stuff and video tuner stuff
due to lack of hardware.
The clipping part (VIDIOCSWIN) needs a little bit of further work (partly
in progress, but can not be tested due to lack of a suitable device).

The submitter tested this sucessfully with Skype and flash apps on amd64 and
i386 with the multimedia/pwcbsd driver.

Submitted by:	J.R. Oldroyd <fbsd@opal.com>
2009-12-04 21:06:54 +00:00
Alexander Leidinger
63f743fb25 Import the unchanged v4l videodev.h from the vendor branch. 2009-12-04 20:46:45 +00:00
Hajimu UMEMOTO
2ea64e8ef9 Use INET_ADDRSTRLEN and INET6_ADDRSTRLEN rather than hard
coded number.

Spotted by:	bz
2009-12-04 15:39:37 +00:00
Andriy Gapon
5e6d0a234e ichsmb: drop default attachment to generic smbus hardware
Attach only to devices known to be supported.
This change overrided and undoes r200053.

Suggested by:	jhb
MFC after:	2 weeks (only to stable/8)
2009-12-04 05:45:46 +00:00
Matt Jacob
a01f5aeb09 Fix cases where we've managed to get a Loop UP event prior to initializing
the loop down counter, as well as other things. This was brought to my
attention with a different fix, more for RELENG_7- this one covers the
multiple channel case.

PR:		140438
MFC after:	1 month
2009-12-04 03:34:12 +00:00
Pyun YongHyeon
d94f2b8506 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.

Reviewed by:	davidch, marius
2009-12-03 23:57:06 +00:00
Andrew Thompson
ce70efd12e Add uhci/ehci controller ids.
Submitted by:	mitya_cabletv.dp.ua
2009-12-03 23:24:12 +00:00
Alexander Motin
891852cc12 Change 'load' balancing mode algorithm:
- Instead of measuring last request execution time for each drive and
choosing one with smallest time, use averaged number of requests, running
on each drive. This information is more accurate and timely. It allows to
distribute load between drives in more even and predictable way.
- For each drive track offset of the last submitted request. If new request
offset matches previous one or close for some drive, prefer that drive.
It allows to significantly speedup simultaneous sequential reads.

PR:		kern/113885
Reviewed by:	sobomax
2009-12-03 21:47:51 +00:00
John Baldwin
eb27d7fb1c Properly return an error reply if an NFS remove or link operation fails.
Previously the failing operation would allocate an mbuf and construct an
error reply, but because the function did not return 0, the NFS server
assumed it had failed to generate a reply and would leak the reply mbuf as
well as not sending the reply to the NFS client.

PR:		kern/140853
Submitted by:	Ted Faber  faber at isi edu (remove)
Reviewed by:	rmacklem (remove)
MFC after:	1 week
2009-12-03 20:59:28 +00:00
Nathan Whitehorn
9fbbaac0bb The first argument of dcbz interprets r0 as a literal zero, not the second.
This worked before by accident.

MFC after:	1 week
2009-12-03 20:55:09 +00:00
Konstantin Belousov
4f17d481ed Remove wrong assertion. Debugee is allowed to lose a signal.
Reported and tested by:	jh
MFC after:	2 weeks
2009-12-03 20:16:59 +00:00
Edward Tomasz Napierala
ff603f2fcc Remove unused code. 2009-12-03 18:16:14 +00:00
Edward Tomasz Napierala
74991298d9 Remove unneeded ifdefs.
Reviewed by:	rmacklem
2009-12-03 18:03:42 +00:00
Andriy Gapon
e72b7e5bba mca: small enhancements related to cpu quirks
- use utility macros for CPU family/model checking
- limit Intel P6 quirk to pre-Nehalem models (taken from OpenSolaris)
- add AMD GartTblWkEn quirk for families 0Fh and 10h; I haven't experienced
  any problems without the quirk but both Linux and OpenSolaris do this
- slightly re-arrange quirk code to provide for the future generalization
  and separation of vendor-specific quirk functions

Reviewed by:	jhb
MFC after:	1 week
2009-12-03 16:10:21 +00:00
Joseph Koshy
c66e06a2f6 Use a better check for a valid kernel stack address when capturing
kernel call chains.

Submitted by:	Mark Unangst <mju at panasas.com>
Tested by:	fabient
2009-12-03 14:59:42 +00:00
Luigi Rizzo
4f60c0b97d preparation work to replace the monster switch in ipfw_chk() with
table of functions.

This commit (which is heavily based on work done by Marta Carbone
in this year's GSOC project), removes the goto's and explicit
return from the inner switch(), so we will have a easier time when
putting the blocks into individual functions.

MFC after:	3 weeks
2009-12-03 14:22:15 +00:00
Edward Tomasz Napierala
6bb58cdd0f Add change that was somehow missed in r192586. It could manifest by
incorrectly returning EINVAL from acl_valid(3) for applications linked
against pre-8.0 libc.
2009-12-03 13:29:24 +00:00
Hajimu UMEMOTO
a22e82b87b Teach an IPv6 to the debug prints. 2009-12-03 11:16:53 +00:00
Andriy Gapon
86439baac2 ichsmb: try attaching only to intel hardware in the default case
Ideally we should attempt attaching only to known supported devices.
But I am not sure that we have all supported PCI IDs already listed,
and I am too young to die, err, I don't want to take the heat from
causing a trouble to someone.

MFC after:	1 week
X-ToDo:		drop the default case
2009-12-03 08:11:20 +00:00
Andriy Gapon
d93b49b38c ichsmb: add pci ids for some newer supported hardware
Submitted by:	Dmitry S. Luhtionov <mitya@cabletv.dp.ua>
MFC after:	5 days
2009-12-03 08:01:29 +00:00
Marcel Moolenaar
4827e0cd5c Make sure bus space accesses use unorder memory loads and stores.
Memory accesses are posted in program order by virtue of the
uncacheable memory attribute.
Since GCC, by default, adds acquire and release semantics to
volatile memory loads and stores, we need to use inline assembly
to guarantee it. With inline assembly, we don't need volatile
pointers anymore.

Itanium does not support semaphore instructions to uncacheable
memory.
2009-12-03 04:06:48 +00:00
Andrew Thompson
3da0423e1c Fix cut'n paste on the AR9280 entry.
Submitted by:	pluknet
2009-12-02 21:22:10 +00:00
Marcel Moolenaar
44979e8d7a Include <sys/sysctl.h>, to get the declarations of ostype and
osrelease. Remove the duplicate declarations from this file.
2009-12-02 20:24:37 +00:00
Edward Tomasz Napierala
92bd961f62 Don't use ap->a_td->td_ucred when we were passed ap->a_cred. 2009-12-02 18:09:22 +00:00
Luigi Rizzo
3c95089ef4 - initialize src_ip in the main loop to prevent a compiler warning
(gcc 4.x under linux, not sure how real is the complaint).
- rename a macro argument to prevent name clashes.
-  add the macro name on a couple of #endif
- add a blank line for readability.

MFC after:	3 days
2009-12-02 17:50:52 +00:00
Konstantin Belousov
4cbf3715bc Bump __FreeBSD_version for sigpause(3) addition [1] and
PIE support in csu.

Requested by:	fluffy [1]
2009-12-02 16:40:23 +00:00
John Baldwin
6b5ba0bba3 ndis_scan_results() can sleep if the scan results are not ready when
ndis_scan() is called.  However, ndis_scan() is invoked from softclock()
and cannot sleep.  Move ndis_scan_results() to the ndis' driver's scan_end
hook instead.

Submitted by:	Paul B Mahol  onemda of gmail
MFC after:	1 week
2009-12-02 16:26:18 +00:00
Scott Long
645275a641 Fix several cases where the periph lock was held over malloc.
Submitted by:	Jaakko Heinonen
2009-12-02 16:08:33 +00:00
Luigi Rizzo
3429911d4d Dispatch sockopt calls to ipfw and dummynet
using the new option numbers, IP_FW3 and IP_DUMMYNET3.
Right now the modules return an error if called with those arguments
so there is no danger of unwanted behaviour.

MFC after:	3 days
2009-12-02 15:50:43 +00:00
Andriy Gapon
d5e341a956 mca: improve status checking, recording and reporting
- directly print mca information in case we fail to allocate memory
  for a record
- include bank number into mca record
- print raw mca status value for extended information

Reviewed by:	jhb
MFC after:	10 days
2009-12-02 15:45:55 +00:00
Luigi Rizzo
0a13f6b1b3 small changes for portability and diff reduction wrt/ FreeBSD 7.
No functional differences.

- use the div64() macro to wrap 64 bit divisions
  (which almost always are 64 / 32 bits) so they are easier
  to handle with compilers or OS that do not have native
  support for 64bit divisions;

- use a local variable for p_numbytes even if not strictly
  necessary on HEAD, as it reduces diffs with FreeBSD7

- in dummynet_send() check that a tag is present before
  dereferencing the pointer.

- add a couple of blank lines for readability near the end of a function

MFC after:	3 days
2009-12-02 15:20:31 +00:00
Hajimu UMEMOTO
fd63c04193 Teach an IPv6 to send_pkt() and ipfw_tick().
It fixes the issue which keep-alive doesn't work for an IPv6.

PR:		kern/117234
Submitted by:	mlaier, Joost Bekkers <joost__at__jodocus.org>
MFC after:	1 month
2009-12-02 14:32:01 +00:00
Gleb Smirnoff
e81ab87652 Until this moment carp(4) used a strange logging priority. It used debug
priority for such important information as MASTER/BACKUP state change,
and used a normal logging priority for such innocent messages as receiving
short packet (which is a normal VRRP packet between some other routers) or
receving a CARP packet on non-carp interface (someone else running CARP).

This commit shifts message logging priorities to a more sane default.
2009-12-02 13:24:21 +00:00
Luigi Rizzo
de9fc6bcd4 Add new sockopt names for ipfw and dummynet.
This commit is just grabbing entries for the new names
that will be used in the future, so you don't need to
rebuild anything now.

MFC after:	3 days
2009-12-02 10:36:41 +00:00
Luigi Rizzo
9565806f16 change the type of the opcode from enum *:8 to u_int8_t
so the size and alignment of the ipfw_insn is not compiler dependent.
No changes in the code generated by gcc.

There was only one instance of this kind in our entire source tree,
so i suspect the old definition was a poor choice (which i made).

MFC after:	3 days
2009-12-02 08:52:06 +00:00
Nathan Whitehorn
50b8e360ac Bump limits on PowerPC. This allows large executables like parts of LLVM
to function.

Reviewed by:	grehan
Obtained from:	NetBSD
MFC after:	2 weeks
2009-12-02 06:49:22 +00:00
Andrew Thompson
1813b93dc1 Add missing ath_ar9* ath hal entries. 2009-12-02 00:38:11 +00:00
Andrew Thompson
d3da916e6e Remove unknown ath hal device entries. 2009-12-02 00:37:03 +00:00
Alexander Motin
f3631e8d74 Add CAM_ATAIO_DMA ATA command flag to mark DMA protocol commands.
It is not needed for SATA controllers, but required for PATA.
2009-12-01 23:01:29 +00:00
Navdeep Parhar
5fbe7b2589 T3 firmware 7.8.0 for cxgb(4)
Obtained from:	Chelsio
MFC after:	3 days
2009-12-01 22:23:15 +00:00
Ed Maste
1a12d24be0 Fix parenthesis typo -- copy full frame pointer for userland callchain,
not just one byte.

Submitted by:	Ryan Stone	rysto32 at gmail dot com
2009-12-01 21:54:53 +00:00
Ed Schouten
6eaf04022b Don't allocate an input buffer for a TTY when the receiver is turned off.
When the termios CREAD flag is not set, it makes little sense to
allocate an input buffer. Just set the size to 0 in this case to reduce
memory footprint.

Disallow CREAD to be disabled for pseudo-devices to prevent
foot-shooting.
2009-12-01 19:14:57 +00:00
Justin T. Gibbs
0e5098428f Add media ioctl support and link notifications so that devd will attempt
to run dhclient on a netfront (xn) device that is setup for DHCP in
/etc/rc.conf.

PR:		kern/136251 (fixed differently than the submitted patch)
2009-12-01 17:29:25 +00:00
John Baldwin
34605f8542 Remove if_timer/if_watchdog now that they are no longer used. The space
used by if_timer is reserved for expanding if_index to an int in the
future.

Reviewed by:	rwatson, brooks
2009-11-30 21:25:57 +00:00
John Baldwin
508cdc242e Remove extra parantheses from usb_ethernet.c and usb_serial.c lines.
config(8) doesn't parse parantheses and instead treated them as being
part of the device driver name (e.g. '(u3g' vs 'u3g').  While here, fix the
style of these long lines to match the wrapping used for other long lines
in this file.

Submitted by:	Brett Glass
MFC after:	1 week
2009-11-30 21:03:44 +00:00
Ed Maste
e182dffce4 Use switch out (SWO) instead of switch in (SWI) debug log mask in csw_out. 2009-11-30 20:41:30 +00:00
Ed Maste
a4911e1696 Free pointer from getenv() when done with it.
Submitted by:	Phil Longstaff
2009-11-30 18:26:46 +00:00
Andriy Gapon
5022f21bd9 amdsbwd: new driver for AMD SB600/SB7xx watchdog timer
The hardware is compliant with WDRT specification, so I originally
considered including generic WDRT watchdog support, but decided
against it, because I couldn't find anyone to the code for me.
WDRT seems to be not very popular.
Besides, generic WDRT porbably requires a slightly different driver
approach.

Reviewed by:	des, gavin, rpaulo
MFC after:	3 weeks
2009-11-30 11:44:03 +00:00
Andriy Gapon
71224c78d4 x86 cpu features: add MOVBE reporting and flag
The check is glimpsed from Linux and OpenSolaris.
MOVBE instruction is found in Intel Atom processors.
2009-11-30 11:11:08 +00:00
Kip Macy
e4808c4b2d Merge Scott Long's latest blkfront now that the licensing issues are resolved 2009-11-30 04:32:34 +00:00
Kip Macy
9999d2cb72 Update license to reflect terms in xen 2.0 as of the time when the driver was ported
to FreeBSD
2009-11-30 04:20:43 +00:00
Nathan Whitehorn
2c494821d4 Add atp(4) to powerpc GENERIC. Most late-generation Apple PowerPC laptops
have trackpads that do not work at all without this driver.
2009-11-29 20:51:23 +00:00
Nathan Whitehorn
d7e7c660b4 Early-generation touchpads do not send periodic calibration frames for
baseline subtraction, and are very temperature sensitive, so would slowly
drift out of a calibrated state when under load. Escape this by taking
the last frame before we decide that the pad is idle as a finger-free
baseline.

Tested on:	iBook G4
2009-11-29 20:48:19 +00:00
Bjoern A. Zeeb
a77cb332ee Enable IPcomp by default.
PR:		kern/123587
MFC after:	5 days
2009-11-29 20:47:43 +00:00
Bjoern A. Zeeb
90b4c081d0 Add more statistics variables for IPcomp.
Try to version the struct in a backward compatible way.
People asked for the versioning of the stats structs in general before.

MFC after:	5 days
2009-11-29 20:37:30 +00:00
Marcel Moolenaar
6852bd671f Move the sysctl related fields to the end of the structure and
make them conditional upon _KERNEL. libkvm includes <sys/pcpu.h>
and <sys/sysctl.h> does not expose the structure definitions to
userland.
2009-11-29 20:17:50 +00:00
Bjoern A. Zeeb
df4dece102 In case the compression result is the same size as the orignal version,
the compression was useless as well.  Make sure to not update the data
and return, else we would waste resources when decompressing.

This also avoids the copyback() changing data other consumers like
xform_ipcomp.c would have ignored because of no win and sent out without
noting that compression was used, resulting in invalid packets at the
receiver.

MFC after:	5 days
2009-11-29 17:53:57 +00:00
Bjoern A. Zeeb
10229cd109 Assimilate very similar input and output code paths
(no real functional change).

MFC after:	5 days
2009-11-29 17:47:49 +00:00
Bjoern A. Zeeb
d8ce467304 Add SDT iter probes forgotten in r199885.
MFC after:	5 days
2009-11-29 17:46:40 +00:00
Bjoern A. Zeeb
afa47e51aa Only add the IPcomp header if crypto reported success and we have a lower
payload size.  Before we had always added the header, no matter if we
actually send out compressed data or not.

With this, after the opencrypto/deflate changes, IPcomp starts to work
apart from edge cases.  Leave it disabled by default until those are
fixed as well.

PR:		kern/123587
MFC after:	5 days
2009-11-29 10:53:34 +00:00
Ed Schouten
f14ad5fa40 Decompose <sys/termios.h>.
The <sys/termios.h> header file is hardlinked to <termios.h>. It
contains both the structures and the flag definitions, but also the C
library interface that's implemented by the C library.

This header file has the typical problem of including too many random
things and being badly ordered. Instead of trying to fix this, decompose
it into two header files:

- <sys/_termios.h>, which contains struct termios and the flags.
- <termios.h>, which includes <sys/_termios.h> and contains the C
  library interface.

This means userspace has to include <termios.h> for struct termios,
while kernelspace code has to include <sys/tty.h>. Also add a
<sys/termios.h>, which prints a warning message before including
<termios.h>. I am aware that there are some applications that use this
header file as well.
2009-11-28 23:50:48 +00:00
Bjoern A. Zeeb
3d34d241be Remove whitespace.
MFC after:	6 days
2009-11-28 21:42:39 +00:00
Bjoern A. Zeeb
4ff9852103 Directly send data uncompressed if the packet payload size is lower than
the compression algorithm threshold.

MFC after:	6 days
2009-11-28 21:40:57 +00:00
Bjoern A. Zeeb
6f443bec58 Change memory managment from a fixed size array to a list.
This is needed to avoid running into out of buffer situations
where we cannot alloc a new buffer because we hit the array size
limit (ZBUF).
Use a combined allocation for the struct and the actual data buffer
to not increase the number of malloc calls. [1]

Defer initialization of zbuf until we actually need it.

Make sure the output buffer will be large enough in all cases.

Details discussed with:	kib [1]
Reviewed by:		kib [1]
MFC after:		6 days
2009-11-28 21:08:19 +00:00
Bjoern A. Zeeb
023795f033 Correct a typo.
MFC after:	6 days
2009-11-28 21:01:26 +00:00
Marcel Moolenaar
1011cc260e Eliminate teh use of MAXCPU in static arrays of interrupt counters by
adding statistics counters to the PCPU structure. Export the counters
through sysctl by giving each PCPU structure its own sysctl context.

While here, fix cnt.v_intr by not just having it count clock interrupts,
but every interrupt and add more counters for each interrupt source.
2009-11-28 21:01:15 +00:00
Nathan Whitehorn
f697a802bb Add support for interpreting taps on ADB touchpads as a button click.
Submitted by:	Andreas Tobler <andreast-list at fgznet dot ch>
MFC after:	2 weeks
2009-11-28 17:48:25 +00:00
Bjoern A. Zeeb
9699afb61b Z_PARTIAL_FLUSH is marked deprecated. Z_SYNC_FLUSH is the suggested
replacement but only use it for inflate. For deflate use Z_FINISH
as Z_SYNC_FLUSH adds a trailing marker in some cases that inflate(),
despite the comment in zlib, does npt seem to cope well with, resulting
in errors when uncompressing exactly fills the outbut buffer without
a Z_STREAM_END and a successive call returns an error.

MFC after:	6 days
2009-11-28 17:44:57 +00:00
Nathan Whitehorn
227f66048e Add a CPU features framework on PowerPC and simplify CPU setup a little
more. This provides three new sysctls to user space:
hw.cpu_features - A bitmask of available CPU features
hw.floatingpoint - Whether or not there is hardware FP support
hw.altivec - Whether or not Altivec is available

PR:		powerpc/139154
MFC after:	10 days
2009-11-28 17:33:19 +00:00
Bjoern A. Zeeb
d9c18e5627 Add SDT probes for opencrypto:deflate:deflate_gobal:*.
They are not nice but they were helpful.

MFC after:	6 days
2009-11-28 17:20:41 +00:00
Bjoern A. Zeeb
df21ad6e41 Define an SDT provider for "opencrypto".
MFC after:	6 days
2009-11-28 16:54:18 +00:00
Bjoern A. Zeeb
e7ad2d3410 Add SDT_PROBE[1-5] in the same way we have SDT_PROBE_DEFINE[1-5] to
avoid having to add all the unused trailing arguments as zeros.

MFC after:	6 days
2009-11-28 16:47:42 +00:00
Ed Schouten
0ab939d261 Include <sys/tty.h> instead of <sys/termios.h>.
Right now <sys/termios.h> includes <sys/ttycom.h>, which provides the
TTY ioctls to the svr4 code. We need both struct termios and the ioctls,
so include <sys/tty.h> for now.
2009-11-28 16:30:06 +00:00
Ed Schouten
5b19140604 Include <sys/ttydefaults.h>, instead of doing it through <sys/termios.h>.
I want to prevent the header polution of <sys/termios.h> eventually.
2009-11-28 16:25:55 +00:00
Ed Schouten
d343f5397d Remove unneeded inclusion of <sys/termios.h>. 2009-11-28 13:20:29 +00:00
Edward Tomasz Napierala
3ce9ca8947 Provide a set of sysctls and tunables to disable device node creation
for specific "kinds" of disk labels - for example, GPT UUIDs.  Reason
for this is that sometimes, other GEOM classes attach to these device
nodes instead of the proper ones - e.g. they attach to /dev/gptid/XXX
instead of /dev/ada0p2, which is annoying.

Reviewed by:	pjd (earlier version)
MFC after:	1 month
2009-11-28 11:57:43 +00:00
Ed Schouten
f02d50a3c8 Remove unneeded includes of <sys/termios.h>. 2009-11-28 11:13:50 +00:00
Alan Cox
79f6ebe233 Properly synchronize the previous change. 2009-11-28 00:50:09 +00:00
Alan Cox
d8778512cf Support the new VM_PROT_COPY option on wired pages. The effect of which
is that a debugger can now set a breakpoint in a program that uses mlock(2)
on its text segment or mlockall(2) on its entire address space.
2009-11-27 22:08:29 +00:00
Alan Cox
e2997fea72 Simplify the invocation of vm_fault(). Specifically, eliminate the flag
VM_FAULT_DIRTY.  The information provided by this flag can be trivially
inferred by vm_fault().

Discussed with:	kib
2009-11-27 20:24:11 +00:00
Michael Tuexen
dec7fa27c6 Use the default stack size for the iterator thread.
This fixes a crash reported by Irene Ruengeler.

Approved by: rrs (mentor)
MFC after: 1 month
2009-11-27 17:25:19 +00:00
Maxim Sobolev
5d695da1d7 Remove spinconsole from pc98, some parts seem to be missed and it's
too late (early?) to figure out what exactly.

Reported by:	TAKAHASHI Yoshihiro
2009-11-27 13:19:06 +00:00
Maxim Sobolev
12ff431c6c Whitespace-only: another instance of identation with spaces. 2009-11-27 04:00:52 +00:00
Maxim Sobolev
8e67cba0d8 Whitespace on: use tabs for identation consistently. 2009-11-27 03:58:21 +00:00
Maxim Sobolev
c4c3b35172 Add new loader console type: "spinconsole". This console selects the
video console which doesn't take any input from keyboard and hides
all output replacing it with ``spinning'' character (useful for
embedded products and custom installations).

Sponsored by:	Sippy Software, Inc.
2009-11-27 03:55:42 +00:00
Attilio Rao
385e11118c i386 has not (yet) any DEV_ATPIC conditional than axe it out from Xen
version.

No objections by:	kmacy
2009-11-27 01:02:17 +00:00
Alexander Motin
eb3d6abdf9 Add two Cirrus Logic codec IDs.
Add GPIO setting quirk for Apple MacBookPro5,5.

Submitted by:	ed
2009-11-26 20:25:57 +00:00
Warner Losh
6bd8c4ff58 This file is OBE and should have been removed when we renamed things
to OCTEON1.hints.

Submitted by:	jmallet
2009-11-26 15:50:52 +00:00
Konstantin Belousov
0d3bc8a930 Implement rtld part of the support for -z nodlopen (see ld(1)).
Reviewed by:	kan
MFC after:	3 weeks
2009-11-26 13:57:20 +00:00
Konstantin Belousov
9a6ceacede Implement sighold, sigignore, sigpause, sigrelse, sigset functions
from SUSv4 XSI. Note that the functions are obsoleted, and only
provided to ease porting from System V-like systems. Since sigpause
already exists in compat with different interface, XSI sigpause is
named xsi_sigpause.

Reviewed by:	davidxu
MFC after:	3 weeks
2009-11-26 13:49:37 +00:00
Alexander Motin
bcbe578a6a Drop USB mass storage devices support from ata(4). It is out of the build as
long as I remember, and completely superseded by better maintained umass(4).
It's main idea was to optionally avoid CAM dependency for such devices, but
with move ATA to CAM, it is not actual any more.

No objections:	hselasky@, thompsa@, arch@
2009-11-26 12:41:43 +00:00
Alexander Motin
b447e682d6 MFp4:
Improve ATA mode/SATA revision control.
2009-11-26 08:49:46 +00:00
Alan Cox
a6d42a0d62 Replace VM_PROT_OVERRIDE_WRITE by VM_PROT_COPY. VM_PROT_OVERRIDE_WRITE has
represented a write access that is allowed to override write protection.
Until now, VM_PROT_OVERRIDE_WRITE has been used to write breakpoints into
text pages.  Text pages are not just write protected but they are also
copy-on-write.  VM_PROT_OVERRIDE_WRITE overrides the write protection on the
text page and triggers the replication of the page so that the breakpoint
will be written to a private copy.  However, here is where things become
confused.  It is the debugger, not the process being debugged that requires
write access to the copied page.  Nonetheless, the copied page is being
mapped into the process with write access enabled.  In other words, once the
debugger sets a breakpoint within a text page, the program can write to its
private copy of that text page.  Whereas prior to setting the breakpoint, a
SIGSEGV would have occurred upon a write access.  VM_PROT_COPY addresses
this problem.  The combination of VM_PROT_READ and VM_PROT_COPY forces the
replication of a copy-on-write page even though the access is only for read.
Moreover, the replicated page is only mapped into the process with read
access, and not write access.

Reviewed by:	kib
MFC after:	4 weeks
2009-11-26 05:16:07 +00:00
Andrew Thompson
767cb2e29d Remove overuse of exclamation marks in kernel printfs, there mere fact a
message has been printed is enough to get someones attention. Also remove the
line number for DPRINTF/DPRINTFN, it already prints the funtion name and a
unique message.
2009-11-26 00:43:17 +00:00
Andrew Thompson
e6af527c11 Disable interrupts after doing early takeover of the usb controller in case usb
isnt actually compiled in (or kldloaded) as the controller could cause spurious
interrupts.

Tested by:	Florian Smeets
2009-11-25 20:50:43 +00:00
Pyun YongHyeon
6a15578d8a Fix typo which inversed the logic which in turn disabled MSI.
Pointy hat to:  yongari
2009-11-25 17:51:14 +00:00
Pyun YongHyeon
7e6acdf12b Make sure one shot MSI is enabled.
Submitted by:	marius
2009-11-25 17:30:38 +00:00
Edward Tomasz Napierala
27565a4094 Be nice, don't use the f-word. 2009-11-25 16:36:07 +00:00
Alexander Motin
1a6f09b826 Fix small copu-paste bug. 2009-11-25 14:24:14 +00:00
Robert Watson
efffdeda35 Fix comment typo.
Submitted by:	Marc Balmer <marc at msys.ch>
MFC after:	3 days
2009-11-25 13:31:17 +00:00
Ivan Voras
cbc4ea28e2 Make ULE process usage (%CPU) accounting usable again by keeping track
of the last tick we incremented on.

Submitted by:	matthew.fleming/at/isilon.com, is/at/rambler-co.ru
Reviewed by:	jeff (who thinks there should be a better way in the future)
Approved by:	gnn (mentor)
MFC after:	3 weeks
2009-11-24 19:57:41 +00:00
Fabien Thomas
5eaf27d8ff - fix a LOR between process lock and pmc thread mutex
- fix a system deadlock on process exit when the sample buffer
is full (pmclog_loop blocked in fo_write) and pmcstat exit.

Reviewed by: jkoshy
MFC after: 3 weeks
2009-11-24 19:26:53 +00:00
John Baldwin
31e119ed7d Use a single private timer to drive the transmit watchdog rather than using
if_watchdog and if_timer from the first port.

Reviewed by:	gonzo
2009-11-24 18:34:47 +00:00
Pyun YongHyeon
fd4d32feb2 BGE_FLAG_40BIT_BUG should be set before creating DMA tags.
Pointy hat to:  yongari
2009-11-24 17:46:58 +00:00
Warner Losh
c64b37ff1f Add in Cavium's CID. Report what the unknown CID is. 2009-11-24 17:15:22 +00:00
Warner Losh
6adde02590 kill stray printf 2009-11-24 17:14:23 +00:00
Warner Losh
0ff75e4f84 Only all critical_enter()/critical_exit() if curthread has been set.
Otherwise we dereference a null pointer and can't get useful panic
info early in boot.
2009-11-24 17:06:11 +00:00
John Baldwin
6d60ecdc6c - For 350 chips, don't set various INTR bits in TX control word; turning INTR
bits on seems to confuse hardware TX engine.
- For 350 chips, set TX desc's buffer physical address before turning on the
  TX desc valid bit.

Submitted by:	Jeremy O'Brien  obrien654j | gmail, sephe
Obtained from:	DragonFly BSD
2009-11-24 16:57:35 +00:00
John Baldwin
08f85872d3 Use bus_*() rather than bus_space_*(). 2009-11-24 16:54:54 +00:00
Warner Losh
73ee766076 looks like there's more to this patch than just this one file. I'll
leave it to neel@ to get all the relevant pieces into the tree.

# we now get well into mi_start before we die
2009-11-24 16:53:58 +00:00
Warner Losh
04c50bba10 Include opt_cputype.h for all .c and .S files referencing TARGET_OCTEON.
Spell ld script name right.

# for the most part, we need to enhance infrastructure to obviate the need
# for such an intrusive option.
2009-11-24 16:32:31 +00:00
Warner Losh
8fccbb54b6 Remove a comment that's bogus.
Include opt_cputype.h since TARGET_OCTEON moved there.
2009-11-24 16:30:29 +00:00
Warner Losh
bf718921ac Make sure kstack0 is page aligned.
# this may have been from neel@ for the sibyte stuff
2009-11-24 16:29:23 +00:00
Warner Losh
715f0e291b Get rid of redundant .kernel in these names. 2009-11-24 14:57:50 +00:00
Alexander Motin
32e7052ed0 Use only lower byte of sectors_intr IDENTIFY word as sector count.
This fixes SET_MULTI error during boot on devices supporting less then
16 sectors per interrupt.
2009-11-24 14:06:15 +00:00
Alexander Motin
c8039fc667 MFp4:
- Extend XPT-SIM transfer settings control API. Now it allows to report to
SATA SIM number of tags supported by each device, implement ATA mode and
SATA revision negotiation for both SATA and PATA SIMs.
- Make ahci(4) and siis(4) to use submitted maximum tag number, when
scheduling requests. It allows to support NCQ on devices with lower tags
count then controller supports.
- Make PMP driver to report attached devices connection speeds.
- Implement ATA mode negotiation between user settings, device and
controller capabilities.
2009-11-24 12:47:58 +00:00
Warner Losh
96a25a70ad Move the hard-wiring of the dcache on octeon outside of the if
statement.  When no caches support was added, it looks like
TARGET_OCTEON was bogusly moved inside the if.  Also, include
opt_cputype.h to make TARGET_OCTEON actually active.

# now we die in pmap init somewhere...  Most likely because 32MB of RAM is
# too tight given the load address we're using.
2009-11-24 08:35:11 +00:00
Warner Losh
29a21af372 TARGET_OCTEON reqiures opt_cputype.h. 2009-11-24 08:21:48 +00:00
Warner Losh
4a2199914f remove bogus panic.
Don't use fortran style line control.
2009-11-24 08:21:23 +00:00
Warner Losh
d2aaaeac19 Rewrite to try to be more sane:
o Introduce a uart bus space so that we don't have to hack dev/uart to do 8
  byte reads.  This also handles the shift properly, so reset the shift we
  want dev/uart doing to 0.  In effect, this bus space makes the octeon
  registers have an interface to dev/uart that looks just like the old ISA
  bus, but does the necessary 64-bit read/write to the bus.  We only support
  read/write operations.  We do all the widths, but likely could get away
  with only 64-bit and 8-bit given the restricted nature of use of this bus.
o use bus_space_map to set the .bsh rather than a direct assignment.
o Minor cleanup of uart_cpu_getdev to make it conform more to the other
  implementations.
o Add some coments for future work.

# with these changes, we now make it through cninit, but there's still some
# problem that's preventing output, as well as another problem that causes
# us to call panic just after we return from cninit() in platform_start.
2009-11-24 07:50:19 +00:00
Warner Losh
dda960c862 Add size of octeon uart registers to map. 2009-11-24 07:41:15 +00:00
Warner Losh
c37c85b0e4 Prefer ANSI spellings of uintXX_t, etc. 2009-11-24 07:40:38 +00:00
Kip Macy
2036720ba9 remove annoying printf that cripples kdb on PV guests 2009-11-24 07:18:38 +00:00
Kip Macy
be7747b449 fixup kernel core dumps on paravirtual guests 2009-11-24 07:17:51 +00:00
Marcel Moolenaar
9c6a6bc422 Improve upon revision 196196 by removing the newly added comment
in the wrong place and instead add a KASSERT in the right place.
2009-11-24 01:35:21 +00:00
Marcel Moolenaar
a78fb6f93d Don't make MJUMPAGESIZE equal to PAGE_SIZE unconditionally.
When PAGE_SIZE is 16K, MJUMPAGESIZE equals MJUM16BYTES and
causes build breakages.
For PAGE_SIZE < 2K, define MJUMPAGESIZE as MCLBYTES.
For PAGE_SIZE > 8K, define MJUMPAGESIZE as 8K.
Everywhere inbetween, define MJUMPAGESIZE as PAGE_SIZE.

Thus MCLBYTES <= MJUMPAGESIZE <= 8KB.
2009-11-23 23:23:05 +00:00
Jung-uk Kim
26b8a1c94f - Add more aggressive BPF JIT optimization. This is in more favor of i386
while the previous commit was more amd64-centric.
- Use calloc(3) instead of malloc(3)/memset(3) in user land[1].

Submitted by:	ed[1]
2009-11-23 22:23:19 +00:00
Marcel Moolenaar
65e962fb76 Revert previous commit. The problem was not related to overrunning
the kernel stack at all. The new USB stack simply caused a change
in timing that triggered a firmware bug more often. The addition
of PRINTF_BUFR_SIZE apparently triggered the same firmware bug
even more reliably.

But even with KSTACK_PAGES=5, one instance of the firmware bug
remained: booting with a CD inserted. This problem was run into
by accident after installing Debian and having to boot FreeBSD
to fixup the GPT partitioning (Thanks... not). After bumping
KSTACK_PAGES to 5, it was pretty unbelievable that the stack was
still being too small.

After updating the firmware we could boot with a CD inserted and
KSTACK_PAGES could be lowered back to 4 pages without problems.

Note: It is believed to be a timing related firmware bug, because
the machine check information showed access to the serial console
on one CPU and access to the EHCI HCD on the other CPU. Since
both are devices on the management unit and thus virtualized in
some way, any execution trace that does not include concurrent
access to the BMC from both CPUs is fine.

Note also that it's not understood exactly how increasing the
kernel stack avoided hitting the firmware bug. A change in page
faults does change timing, but it's not known if that's what's
happening here.

In any case: the problem is being monitored. Reverting back to
4 pages for the kernel stack is preferred, because it makes it
easier to switch to 16K pages (double the page size) without
wasting too much memory by not being able to half the number of
pages...
2009-11-23 21:09:23 +00:00
Andrew Thompson
bda9babe90 Actually disable interrupts in ehci_detach().
Reviewed by:	HPS
2009-11-23 18:12:09 +00:00
Alexander Motin
9ece9ab1eb Do not attach JMicrons with single PCI function. They are not working as
AHCI for some reason, even when declaring so. Let atajmicron configure
them for us and provide PATA support.
2009-11-23 18:07:28 +00:00
Rick Macklem
38e3ea69d4 Modify the experimental nfs server so that it falls back to
using VOP_LOOKUP() when VFS_VGET() returns EOPNOTSUPP in the
ReaddirPlus RPC. This patch is based upon one by pjd@ for the
regular nfs server which has not yet been committed. It is needed
when a ZFS volume is exported and ReaddirPlus (which almost
always happens for NFSv4) is performed by a client. The patch
also simplifies vnode lock handling somewhat.

MFC after:	2 weeks
2009-11-23 16:08:15 +00:00
Robert Noland
f06c961ee3 Create a seperate ZFS enabled loader.
This adds zfsloader which will be called by zfsboot/gptzfsboot code rather
than the tradional loader.  This eliminates the need to set the
LOADER_ZFS_SUPPORT variable in order to get a ZFS enabled loader.

Note however, that you must reinstall your bootcode (zfsboot/gptzfsboot)
in order for the boot process to use the new loader.

New installations will no longer be required to build a ZFS enabled
loader for a working ZFS boot system.  Installing zfsboot/gptzfsboot is
sufficient for acknowledging the use of CDDL code and therefore the ZFS
enabled loader.

Based on a previous patch from jhb@

Reviewed by:	jhb@
MFC after:	2 weeks
2009-11-23 16:00:16 +00:00
Warner Losh
bdc7523ccf Specify loader script and load address 2009-11-23 07:49:50 +00:00
Warner Losh
e04942b0d7 Start linking at the kernel link address....
# this gets me a loading, but not working, kernel on octeon's simulator.
2009-11-23 07:49:22 +00:00
Warner Losh
cefc105a54 Linker scripts for octeon1 kernels of various flavors. 2009-11-23 07:11:10 +00:00
Andrew Thompson
3e65f9971a Make the mode setting transfer asynchronous.
Submitted by:	Rohit Grover
2009-11-22 21:53:09 +00:00
Pyun YongHyeon
30f57f615b 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.
2009-11-22 21:45:55 +00:00
Andrew Thompson
add5cc2fad Add missed register change in r199676.
Submitted by:	Hans Petter Selasky
2009-11-22 21:31:31 +00:00
Andrew Thompson
dc6942514b add support for MIDI devices without audio control stream.
Submitted by:	Hans Petter Selasky
2009-11-22 21:26:27 +00:00
Andrew Thompson
f1eac1007e Correct register access for USB device side operation on the musb controller.
Submitted by:	Hans Petter Selasky
2009-11-22 21:24:38 +00:00
Andrew Thompson
c13fd8d42b Provide tunables for some of the usb sysctls that affect boot behaviour.
Submitted by:	Andriy Gapon
2009-11-22 21:21:22 +00:00
Pyun YongHyeon
2e1d4df419 Add missing function prototype in r199671. 2009-11-22 21:20:26 +00:00
Andrew Thompson
78c94708fb Initialise variable before use.
Submitted by:	Hans Petter Selasky
2009-11-22 21:19:01 +00:00
Andrew Thompson
f12c6c2913 Improve High Speed slot allocation mechanism by moving the computation to the
endpoint rather than per xfer and provide functions around get/free of resources.

Submitted by:	Hans Petter Selasky
2009-11-22 21:16:43 +00:00
Pyun YongHyeon
ca3f1187f1 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.

Tested by:	current
2009-11-22 21:16:30 +00:00
Pyun YongHyeon
f681b29a6d 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.

Reviewed by:	davidch
2009-11-22 20:50:27 +00:00
Nathan Whitehorn
961e3d1410 Garbage collect some code that was never compiled in to handle Altivec
during traps. It predates actual Altivec support and was never used.
2009-11-22 20:45:15 +00:00
Pyun YongHyeon
dfe0df9a76 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.
2009-11-22 20:31:40 +00:00
Pyun YongHyeon
b9c05fa593 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.
2009-11-22 20:02:13 +00:00
Pyun YongHyeon
167fdb62e3 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.
2009-11-22 19:44:11 +00:00
Pyun YongHyeon
d77e9fa7be Controller does not write Rx descriptors, remove BUS_DMASYNC_PREREAD. 2009-11-22 19:17:32 +00:00
Pyun YongHyeon
0aaf10578c 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.

Reviewed by:	marius
2009-11-22 19:11:34 +00:00
Pyun YongHyeon
d648358b0b 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.

Reviewed by:	marius
2009-11-22 18:47:56 +00:00
Pyun YongHyeon
1b90d0bd3e Fix typo introduced in r199011.
Pointed out by:	marius
2009-11-22 18:34:15 +00:00
Pyun YongHyeon
1715ec0d32 Remove extra white space. 2009-11-22 18:30:19 +00:00
Alexander Motin
301f81f0fb Release over-agressive WDMA0 mode timings as close to spec as chip can. 2009-11-22 12:19:50 +00:00
Alexander Motin
48a21eb99c Fix Intel PATA UDMA timings setting, affecting write performance.
Binary divider value 10 specified in datasheet is not a hex 0x10.
UDMA2 should be 33/2 instead of 66/4, which is documented as reverved,
UDMA4 should be 66/2 instead of 66/4, which is definitely wrong.
2009-11-22 11:17:31 +00:00
Jung-uk Kim
35012a1e69 Add an experimental and rudimentary JIT optimizer to reduce unncessary
overhead from short BPF filter programs such as "get the first 96 bytes".
2009-11-21 00:19:09 +00:00
Konstantin Belousov
080136212f On the return path from F_RDAHEAD and F_READAHEAD fcntls, do not
unlock Giant twice.

While there, bring conditions in the do/while loops closer to style,
that also makes the lines fit into 80 columns.

Reported and tested by:	dougb
2009-11-20 22:22:53 +00:00
Rick Macklem
086f6e0cc7 Patch the experimental NFS server is a manner analagous to
r197525, so that the creation verifier is handled correctly
in va_atime for 64bit architectures. There were two problems.
One was that the code incorrectly assumed that
sizeof (struct timespec) == 8 and the other was that the tv_sec
field needs to be assigned from a signed 32bit integer, so that
sign extension occurs on 64bit architectures. This is required
for correct operation when exporting ZFS volumes.

Reviewed by:	pjd
MFC after:	2 weeks
2009-11-20 21:21:13 +00:00
Jung-uk Kim
c12b965f99 General style cleanup, no functional change. 2009-11-20 21:12:40 +00:00
Pyun YongHyeon
ed848e3a02 Only Tx checksum offloading is supported now. Remove experimental
code sneaked in r199611.
2009-11-20 20:43:16 +00:00
Pyun YongHyeon
fe42b04d70 Add __FBSDID. 2009-11-20 20:40:34 +00:00
Pyun YongHyeon
9955274c64 Add IPv4/TCP/UDP Tx checksum offloading support. It seems the
controller also has support for IP/TCP checksum offloading for Rx
path. But I failed to find to way to enable Rx MAC to compute the
checksum of received frames.
2009-11-20 20:33:59 +00:00
Pyun YongHyeon
abd12fc6d6 Because we know received bytes including CRC there is no reason to
call m_adj(9). The controller also seems to have a capability to
strip CRC bytes but I failed to activate this feature except for
loopback traffic.
2009-11-20 20:25:21 +00:00
Pyun YongHyeon
26e07b50c6 Add initial endianness support. It seems the controller supports
both big-endian and little-endian format in descriptors for Rx path
but I couldn't find equivalent feature in Tx path. So just stick to
little-endian for now.
2009-11-20 20:18:53 +00:00
Pyun YongHyeon
bbd5260f13 Remove unnecessary structure packing. 2009-11-20 20:12:37 +00:00
Jung-uk Kim
5ecf77367c - Allocate scratch memory on stack instead of pre-allocating it with
the filter as we do from bpf_filter()[1].
- Revert experimental use of contigmalloc(9)/contigfree(9).  It has no
performance benefit over malloc(9)/free(9)[2].

Requested by:	rwatson[1]
Pointed out by:	rwatson, jhb, alc[2]
2009-11-20 18:49:20 +00:00
Marcel Moolenaar
0c8e3b18f0 Always allocate PCI/ISA interrupts as shareable so that shared
interrupts don't cause driver attach failures.
2009-11-20 17:59:50 +00:00
Warner Losh
714697cd3d Another kludge for 64-bit bus_addr_t with 32-bit pointers... 2009-11-20 16:32:26 +00:00
Warner Losh
10153d080c Horrible kludge to make octeon32 work. I think a better way is to
move the generic code into the config files....
2009-11-20 16:30:35 +00:00
Warner Losh
1e80c0e4aa cast vaddr to uintptr_t before casting it to a bus_space_handle_t.
# I'm sure this indicates a problem, but I'm not sure what...
2009-11-20 16:27:50 +00:00
Warner Losh
e7a9535945 32-bit mixed-mode OCTEON kernel config file. 2009-11-20 16:23:04 +00:00
Warner Losh
6962307a9a If we're ompiling ISA_MIPS32, then use the 32-bit address-size
definitions.
2009-11-20 15:59:41 +00:00
Warner Losh
6ecc37e794 Don't assume register addresses can fit into void *. Minor formatting
simplification while I'm here.
2009-11-20 15:57:45 +00:00
Warner Losh
21ed765c7f Formatting nit. 2009-11-20 15:56:51 +00:00
Rafal Jaworowski
04311706d0 tsec: Use IFQ_DRV macros for managing interface packet queue.
This lets tsec(4) work with ALTQ.

Submitted by:	Marcin Ligenza
MFC after:	1 week
2009-11-20 13:28:06 +00:00
John Baldwin
c6858769af Always use 64-bit LBAs for disk addresses in zfsboot and gptzfsboot to
fully support booting from large volumes.

Tested by:	Emil Smolenski  ambsd of raisa.eu.org
Submitted by:	Matt Reimer  mattjreimer of gmail (most of the C bits)
MFC after:	1 week
2009-11-20 12:48:35 +00:00
Andrew Thompson
7fb4357098 remove volume alignment (was previously not correctly implemented)
Submitted by:	HPS
Reported by:	Jaakko Heinonen
2009-11-20 09:00:38 +00:00
Marcel Moolenaar
1c8a163c8b No need to include opt_kstack_pages.h, because KSTACK_PAGES is
already defined through genassym.c
2009-11-20 07:40:02 +00:00
Marcel Moolenaar
02b5a86f38 Add a seatbelt to the Nested TLB Fault handler to give us a chance
to panic when we have an unexpected TLB fault while interrupt
collection is disabled. Use a token rather than the actual address
of the restart point to avoid the need for the movl instruction.
The token is arbitrary. For the drummers: it's based on a single
paradiddle.
2009-11-20 03:14:54 +00:00
Pyun YongHyeon
01d1a6c355 Move interface reinitialization down after disabling WOL in resume
path.
2009-11-19 23:14:40 +00:00
Pyun YongHyeon
8476c243bb Minimize interface reinitialization by checking IFF_DRV_RUNNING
flag. This fixes unnecessary interface UP/DOWNs during getting an
IP address via DHCP.

Tested by:	Warren Block ( wblock<> wonkity dot com )
2009-11-19 23:12:44 +00:00
Pyun YongHyeon
accb4fcd92 Fix copy & paste error and remove extra space before colon.
Pointed out by: danfe
2009-11-19 22:59:52 +00:00
Pyun YongHyeon
8b3c64969b Use capability pointer to access PCIe registers rather than
directly access them at fixed address. Frequently the register
offset could be changed if additional PCI capabilities are added to
controller.
One odd thing is ET_PCIR_L0S_L1_LATENCY register. I think it's PCIe
link capabilities register but the location of the register does
not match with PCIe capability pointer + offset. I'm not sure it's
shadow register of PCIe link capabilities register.
2009-11-19 22:53:41 +00:00
John Baldwin
e55bc0154d - Hook into the existing stat timer to drive the transmit watchdog instead
of using if_watchdog and if_timer.
- Reorder detach to call ether_ifdetach() before anything else in tl(4)
  and wb(4).
2009-11-19 22:14:23 +00:00
John Baldwin
7cf545d0a1 - 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.
2009-11-19 22:06:40 +00:00
Pyun YongHyeon
d95121b427 Use bus_{read,write}_4 rather than bus_space_{read,write}_4. 2009-11-19 22:06:19 +00:00
John Baldwin
3064f0530b - Initialize callout before it is used in atestop() during attach.
- Reorder detach so that ether_ifdetach() is called first.  This removes
  the race that ATE_FLAG_DETACHING closed, so that flag can be removed.
- Trim a duplicate clearing of IFF_DRV_RUNNING.

Reviewed by:	imp
2009-11-19 22:04:02 +00:00