Commit Graph

14179 Commits

Author SHA1 Message Date
Søren Schmidt
c6c6c58a89 Correct calculation of RAID0 sizes on VIA RAID arrays. 2005-12-14 12:11:51 +00:00
Scott Long
5351742ea2 Mega update to the LSI MegaRAID driver:
1.  Implement a large set of ioctl shims so that the Linux management apps
from LSI will work.  This includes infrastructure to support adding, deleting
and rescanning arrays at runtime.  This is based on work from Doug Ambrosko,
heavily augmented by LSI and Yahoo.

2.  Implement full 64-bit DMA support.  Systems with more than 4GB of RAM
can now operate without the cost of bounce buffers.  Cards that cannot do
64-bit DMA will automatically revert to using bounce buffers.  This option
can be forced off by setting the 'hw.amr.force_sg32" tunable in the loader.
It should only be turned off for debugging purposes.  This work was sponsored
by Yahoo.

3.  Streamline the command delivery and interrupt handler paths after
much discussion with Dell and LSI.  The logic now closely matches the
intended design, making it both more robust and much faster.  Certain
i/o failures under heavy load should be fixed with this.

4.  Optimize the locking.  In the interrupt handler, the card can be checked
for completed commands without any locks held, due to the handler being
implicitely serialized and there being no need to look at any shared data.
Only grab the lock to return the command structure to the free pool.  A
small optimization can still be made to collect all of the completions
together and then free them together under a single lock.

Items 3 and 4 significantly increase the performance of the driver.  On an
LSI 320-2X card, transactions per second went from 13,000 to 31,000 in my
testing with these changes.  However, these changes are still fairly
experimental and shouldn't be merged to 6.x until there is more testing.

Thanks to Doug Ambrosko, LSI, Dell, and Yahoo for contributing towards
this.
2005-12-14 03:26:49 +00:00
Scott Long
6239708b1c Fix the Tigon I/II driver to support 64-bit DMA. In the process, convert it
to use busdma.  Unlike most of the other drivers, but similar to the
if_em driver, pre-allocate the dmamaps at init time instead of allocating
them on the fly when descriptors need to be filled.  This isn't ideal right
now because a map is allocated for every descriptor slot in the tx, rx, mini,
and jumbo rings (which is a lot!) in order to simplify the bookkeeping, even
though the driver might support filling only a subset of those slots.
Luckily, maps are typically NULL on i386 and amd64, so the cost isn't
very high.  It could be an issue with sparc64, but the driver isn't endian
clean either, and that is a much bigger problem to solve first.

Note that jumbo frame support is under-tested, and I'm not even sure if
it till really works correctly given the evil VM magic that is does.
The changes here attempt to preserve the existing semanitcs.

Thanks to Martin Nillson for contributing the Netgear card for this work.

MFC-After: 3 weeks
2005-12-14 00:03:41 +00:00
Marcel Moolenaar
2778b70e71 In bge_link_upd(), rewrite the logic so that status is assigned
on the code path it is used in a way that GCC understands. This
avoids breakage due to higher optimization levels.
2005-12-13 06:14:14 +00:00
Warner Losh
fbd68c4b4c Make uart_getenv() not be ns8250 dependent. This will allow, in the future,
compilation of kernels without ns8250 support but using the uart framework.
These kernels will be for machines where size matters more, so including code
that can never be executed is undesriable...
2005-12-12 21:00:58 +00:00
Gleb Smirnoff
02a101a611 - Polling can be used on SMP.
- A kernel module can support polling.
2005-12-12 19:29:30 +00:00
Maxime Henrion
52dfd9cdad Add the device ID of fxp(4) NICs found in Sony Vaio VGN-TX1XP laptops.
PR:		kern/90024
Submitted by:	Thomas Hurst <tom@hur.st>
MFC after:	3 days
2005-12-12 14:30:13 +00:00
Søren Schmidt
921f15117f Add support for writing SiS metadata. 2005-12-12 14:13:55 +00:00
Bruno Ducrot
f9ead0fcbe Don't flood kernel logs with "invalid _PSS package" messages.
Approved by:	njl, imp (mentor)
2005-12-12 11:15:20 +00:00
Bjoern A. Zeeb
3e4212785c Make nve(4) work for people with nf3/nf4 who never got it
working at all and only saw "nve0: device timeout (N)" messages.

- Setup PHY before handing control to NVidia API setting
  speed, duplex, enabling interrupts, etc.
- Add restriction of MAXADDR_32BIT for high address to contigmalloc
  to make the driver work on machines with 4+GB of memory.

PR:        kern/85583, kern/88045
Tested by: scottl, others earlier version
MFC after: 10 days
2005-12-12 06:23:43 +00:00
Florent Thoumie
17e41731b7 - Rename UQ_BROKEN_IPOD to UQ_NO_OPEN_CLEARSTALL since it's likely to be used
by more devices than iPods.

Proposed by:	iedowse
Approved by:	ssouhlal
MFC after:	3 days
2005-12-11 20:14:38 +00:00
Scott Long
d29dab303f Allocate the jumbo rx frame buffer with busdma. 2005-12-10 08:58:48 +00:00
Scott Long
33ffa5853a if_ti has been operating with locks for a while, so remove the GIANT markers.
Also fix man potential locking problems in the cdev ioctl handler.
2005-12-10 01:25:46 +00:00
Scott Long
73c8420784 The if_ti Tigon I/II driver has moved to /sys/dev/ti 2005-12-10 00:38:33 +00:00
Søren Schmidt
fb504bef5c Unbreak hotplug support on the ICH6 and ICH7 chipsets. 2005-12-09 14:23:24 +00:00
Warner Losh
c46a4f9afd Careful measurement of the ST Labs card shows that the pulse width of
transmitted bits was between 8.6180us and 8.6200us when we used a RCLK
of 16.500MHz.  This is a little low (should be 8.6805us).  This error
is exactly the error one would expect if it actually had a 16.384MHz
watch oscillator (as suggested by garrett) instead of using the PCI
RCLK.  Assume that the pci clock therefore wasn't really used, but
instead the cheap 16.384MH watch quartz oscillator.  This gives bits
in the 8.6800us to 8.6810us ranage, which matches theoretical.

Submitted by: garrett
2005-12-08 22:29:42 +00:00
Gleb Smirnoff
1be6acb7c0 A big rewrite of receive Jumbo frame handling. Remove the local Jumbo
cluster allocator, that wasn't MPSAFE. Instead, utilize our new generic
UMA jumbo cluster allocator. Since UMA gives us a 9k piece that is contigous
in virtual memory, but isn't contigous in physical memory we need to handle
a few segments. To deal with this we utilize Tigon chip feature - extended
RX descriptors, that can handle up to four DMA segments for one frame.

Details:

o Remove bge_alloc_jumbo_mem(), bge_free_jumbo_mem(),
  bge_jalloc(), bge_jfree() functions.
o Remove SLIST heads, bge_jumbo_tag, bge_jumbo_map from softc.
o Use extended RX BDs for Jumbo receive producer ring, and
  initialize it appropriately.
o New bge_newbuf_jumbo():
  - Allocate an mbuf with Jumbo cluster with help of m_cljget().
  - Load the cluster for DMA with help of bus_dmamap_load_mbuf_sg().
  - Assert that we got 3 segments in the DMA mapping.
  - Fill in these 3 segments into the extended RX descriptor.
2005-12-08 16:11:45 +00:00
Oleg Bulyzhin
dab5cd0588 1) fix tiny bug in bge_start_locked()
2) rework link state detection code & use it in POLLING mode
3) fix 2 bugs in link state detection code:
	a) driver unable to detect link loss on bcm5721
	b) on bcm570x chips (tested on bcm5700 bcm5701 bcm5702) driver fails
	   to detect link loss with probability 1/6 (solved in brgphy.c)

Devices working in TBI mode should not be affected by this change.

Approved by:	glebius (mentor)
MFC after:	1 month
2005-12-08 13:31:52 +00:00
Ian Dowse
2b58bea7c0 Reorder the calling of the completion callback and the transfer
"done" method so that for non-repeat operations we have completely
finished with the transfer by the time the callback is invoked.
This makes it possible to recycle a transfer from within the callback
routine for the same transfer. Previously this almost worked, but
with OHCI controllers calling the "done" method after the callback
would zero out some important fields needed by the recycled transfer.
Only some usb peripheral drivers such as ucom appear to rely on the
ability to reuse a transfer from its callback.

MFC after:	1 week
2005-12-08 03:08:17 +00:00
David E. O'Brien
9da0c15871 Add support for the nVidia nForce MCP12 & MCP13 Networking Adapters. 2005-12-07 17:38:03 +00:00
David E. O'Brien
6e24020ff6 Catch up to the nvenetlib 1.0-0310 import. 2005-12-07 17:36:53 +00:00
Warner Losh
5d4d5ea6e1 Use __DEVOLATILE to cast conspeed. 2005-12-07 07:23:53 +00:00
Nate Lawson
31bef809aa Revert two changes I was testing regarding polling delay. 2005-12-06 14:51:55 +00:00
Nate Lawson
c4a9fa4529 Add KTR support and move some performance debugging variables in the EC
to KTR.  We're reusing the KTR_DEV level.
2005-12-06 14:47:28 +00:00
Ruslan Ermilov
44e09d2fa2 Fix -Wundef warnings from compiling GENERIC and LINT kernels of
all architectures.
2005-12-06 11:19:37 +00:00
Warner Losh
7640c87195 The Oxford 16C950 based CardBus Serial device that I was given some
time ago appears to be based not on the typical 1.8432MHz clock, or
the other more typical multiple of 8 of this (14.7456MHz), but instead
it appears to be 1/2 the PCI clock rate or 16.50000MHz.  I'm not 100%
sure that this is right, but since I did the original entry, I'm going
to go ahead and modify it.  With the 14.7456MHz value, I was getting
bits that were ~7.3us instead of ~8.6us like they are supposed to be.

My measuring gear for today is a stupid handheld scope with two
signficant digits.  So I don't know if it is 33.000000/2 MHz or some
other value close to 16.5MHz, but 16.5MHz works well enough for me to
use a couple of different devices at 115200 baud, and is a nice even
multiple of a well known clock frequency...
2005-12-05 23:30:28 +00:00
Scott Long
dc7a8b0067 FreeBSD has had endian conversion macros for a long time. Axe the custom
macros in this driver.

MFC After: 3 days
2005-12-05 22:37:37 +00:00
Søren Schmidt
b39424ba7a Dont use the BUS_DMA_ALLOCNOW flag. Instead use BUS_DMA_NOWAIT and return
ENOMEM to the upper layers if we run out of memory.

This solves part of the trouble with running on >4GB memory systems.
2005-12-05 22:31:55 +00:00
John Baldwin
7e70788a5c Remove unused local variable misssed in previous commit. 2005-12-05 22:20:23 +00:00
John Baldwin
5714e9ea59 - Don't make the driver lock recursive, it shouldn't be recursively
acquired anywhere in the driver now.
- Axe the spin mutex used for the nve_oslock*() routines.  The driver lock
  already provides sufficient synchronization.
- Don't mess around with IFF_UP when the link state changes.  IFF_UP is
  an administrative flag, not a link status indicator.

MFC after:	1 week
2005-12-05 20:49:45 +00:00
John Baldwin
f9959468bb If pci_link has been disabled via the acpi_disable tunable, then bail
immediately from acpi_pci_link_route_interrupt() since we aren't going
to have a valid pci_link device to talk to try to route interrupts.  This
fixes a page fault if you disable just pci_link.  Note that trying to use
ACPI without pci_link is probably not advised however.

MFC after:	1 week
Tested by:	Eugene Grosbein eugen at kuzbass dot ru
2005-12-05 19:50:00 +00:00
Søren Schmidt
02268a2d11 Switch off debugging that was left on in last commit. 2005-12-05 17:58:11 +00:00
Søren Schmidt
eed08844c9 Add support for writing Intel MatrixRAID arrays.
Do a little better on handling volumes as well, however we cant create
multiple volumes from FreeBSD yet.

HW sponsored by:        Mullet Scandinavia AB
2005-12-05 17:33:57 +00:00
Marius Strobl
802cab0330 - Rev. 1.175 fixed compilation on sparc64 but also backed out zeroing of
the eaddr array (introduced in rev. 1.174) prior to writing to it. As
  dc_read_eeprom() is told to write only 3 16-bit words to eaddr but eaddr
  in fact is somewhat larger removal of the zeroing defeated the check
  whether the MAC address is all zero as there can be some random garbage
  in eaddr past the 3 words written to it and the check verifys all bits
  in eaddr. Solve this by changing the check to verify only the 3 words
  (happenning to be ETHER_ADDR_LEN bytes) written to eaddr.
- While here change the notation of "FCode" in a nearby comment to the
  official way.

Ok'ed by:	marcel, ru
2005-12-05 12:32:20 +00:00
Ruslan Ermilov
342ed5d948 Fix -Wundef warnings found when compiling i386 LINT, GENERIC and
custom kernels.
2005-12-05 11:58:35 +00:00
Florent Thoumie
645cf3805a - Add Product IDs for iPod 3G and iPod Video.
- Add an USB quirk for iPods, da(4) devices are now successfully created.

Approved by:	ssouhlal
MFC after:	1 week
2005-12-05 01:51:28 +00:00
Ruslan Ermilov
2a40d89ff4 Use compile-time detection of 64-bit addressing. 2005-12-04 12:37:19 +00:00
Ruslan Ermilov
69a7db097e Use a compile-time detection of 64-bit addressing so that this
compiles on 32-bit machines.

Reported by:	ale
2005-12-04 12:30:34 +00:00
Ruslan Ermilov
3238c6bd33 Fix -Wundef from compiling the amd64 LINT. 2005-12-04 10:06:06 +00:00
Ruslan Ermilov
4cbc44fb19 Fix -Wunder and make the sbus code really compile only on sparc64. 2005-12-04 10:03:00 +00:00
Ruslan Ermilov
77cd5a64cf Fix -Wundef warnings and properly check the size of long, FWIW. 2005-12-04 10:01:44 +00:00
Ruslan Ermilov
8069c79ddd Fix on sparc64. 2005-12-04 07:45:12 +00:00
Bruce A. Mah
71ddfdfb45 Recognize the Sony Clie PEG-TJ37.
Tested on:	My PEG-TJ37 and my RELENG_6 workstation
MFC after:	1 week
2005-12-04 07:34:19 +00:00
Ruslan Ermilov
f4e9888107 Fix -Wundef. 2005-12-04 02:12:43 +00:00
John Baldwin
d37d99c4aa Force any hardwire-routed interrupts to level trigger and active low
polarity.  Some machines route PCI IRQs to an ISA IRQ but fail to include
an interrupt override entry to set the polarity and trigger of the given
ISA IRQ in their MADT table.

PR:		usb/74989
Reported by:	Julien Gabel jpeg at thilelli dot net
MFC after:	1 week
2005-12-03 21:17:17 +00:00
Eric Anholt
69b9fffc84 Merge DRM CVS as of 2005-12-02, adding i915 DRM support thanks to Alexey Popov,
and a new r300 PCI ID.
2005-12-03 01:23:50 +00:00
Eric Anholt
c703850cb4 Make cleaner diffs by munging the $FreeBSD$s from the FreeBSD CVS sources back
into the new sources.
2005-12-03 00:43:57 +00:00
Eric Anholt
8ec9a6c5a6 Add support for i915 GMCH AGP. This diff is a combination of work by myself
and some fixes from Motomichi Matsuzaki.  Testing involved many people, but the
final, successful testing was from rwatson who endured several rounds of "it
crashes at XYZ stage" "oh, please correct this typo and try again."  The Linux
driver, and to a small extent the limited specs, were both used as a reference
for how to program the chipset.

PR:		kern/80396
Submitted by:	Martin Mersberger
2005-12-02 23:51:36 +00:00
Peter Grehan
e2b03d4d48 Register definitions for the ancient via6522. This 20+ year-old chip
still exists as a cell in the Macio asic on Apples, and is used to communicate
through the shift register with the external PMU microcontroller.
2005-12-02 22:36:14 +00:00
John Baldwin
80f049d359 Add a missing newline to a printf.
MFC after:	1 week
2005-12-02 13:35:14 +00:00