Commit Graph

9236 Commits

Author SHA1 Message Date
Orion Hodson
4f3204ef22 Fix lock order reversal when opening device and chn_reset fails.
Submitted by: Jan-Espen Pettersen <sigsegv@leakingmemory.org>
Tested by: Georg Funk <georgfunk@web.de>
2003-05-01 16:31:21 +00:00
Greg Lehey
9db2b74e40 Note when we issue a request to the disk driver, so that we can
measure the time it spends.
2003-05-01 13:06:00 +00:00
Martin Blapp
acc1bccccd Use only a 64bit hash filter table for ADM-Centaur cards like the
Accton EN2242 and the ADMtek AN985 cards.

PR:		32699
Submitted by:	Jean-Luc Richier <Jean-Luc.Richier@imag.fr>
Reviewed by:	phk
MFC after:	2 weeks
2003-05-01 09:31:01 +00:00
Søren Schmidt
84351184a9 I'm pleased to announce that Promise is now supporting the FreeBSD
project by providing documentation (under NDA) and hardware for
testing. This commit is the first result of the cooperation, and
adds support for several of their new controllers that we didn't
support before (and probably newer would have without this arrangement).

Add support for the Promise SATA150 TX2/TX4 and the Promise TX4000
controllers. This also adds support for various motherboard fitted
Promise SATA/ATA chips.
Note that this code uses memory mapped registers to minimize overhead.
I belive FreeBSD has made another first in the Open Source world
by being able to release support for this :)
2003-05-01 06:20:50 +00:00
Søren Schmidt
3a6fb16ff1 Relax the test for when to use LBA instead of CHS size. 2003-05-01 06:17:30 +00:00
Peter Wemm
8c3765708a Add AMD64 support to dev/fb. It isn't optimized. 2003-05-01 04:21:05 +00:00
Peter Wemm
25b0a17506 Update the hardcoded bus tags for early console support for amd64. 2003-05-01 04:19:19 +00:00
Hidetoshi Shimokawa
e47276e59c Fix printf warning caused by recent CAM change. 2003-05-01 03:38:04 +00:00
Greg Lehey
03c03f6cf4 Rewrite minor number decoding. Now we have only three types of
object: subdisks, plexes and volumes.  The encoding for plexes and
subdisks no longer reflects the object to which they belong.  The
super devices are high-order volume numbers.  This gives vastly more
potential volumes (4 million instead of 256).
2003-05-01 01:35:03 +00:00
Greg Lehey
bf7cea1cc0 For consistency's sake, on command failure, throw 1, not -1.
Rewrite minor number decoding.  Now we have only three types of
object: subdisks, plexes and volumes.  The encoding for plexes and
subdisks no longer reflects the object to which they belong.  The
super devices are high-order volume numbers.  This gives vastly more
potential volumes (4 million instead of 256).
2003-05-01 01:34:38 +00:00
Greg Lehey
0910419967 Rewrite minor number decoding. Now we have only three types of
object: subdisks, plexes and volumes.  The encoding for plexes and
subdisks no longer reflects the object to which they belong.  The
super devices are high-order volume numbers.  This gives vastly more
potential volumes (4 million instead of 256).

Correct formats for some error messages.  Don't cast the value to
match the format.
2003-05-01 01:34:05 +00:00
Greg Lehey
9ebe817222 Rewrite minor number decoding. Now we have only three types of
object: subdisks, plexes and volumes.  The encoding for plexes and
subdisks no longer reflects the object to which they belong.  The
super devices are high-order volume numbers.  This gives vastly more
potential volumes (4 million instead of 256).

Tidy up comments.

Check for null rqgs.  This continue to be reported, though I can't
work out why.

Correct formats for some error messages.  Don't cast the value to
match the format.

Use microtime, not getmicrotime, for timing debug entries.
2003-05-01 01:33:34 +00:00
Greg Lehey
f77547fbbb Terminate a comment. 2003-05-01 01:33:01 +00:00
Greg Lehey
9351e5dbcc Don't make definition of kw_debug dependent on VINUMDEBUG. In
userland, define the keyword even if the kernel module doesn't have
debug code.
2003-05-01 01:32:31 +00:00
Greg Lehey
25d8d1f1a9 Use strrchr, not rindex. This is for compatibility with other
systems, and requires a #define.
2003-05-01 01:32:08 +00:00
Greg Lehey
130101dd9d #ifdef VINUMDEBUG, not #if VINUMDEBUG. 2003-05-01 01:31:48 +00:00
Greg Lehey
de7d0dd0eb Don't make definition of kw_debug dependent on VINUMDEBUG. It's only
an enum value, and dropping it can lead to some spectacular surprises
in userland.
2003-05-01 01:31:20 +00:00
Greg Lehey
01fbffad0e Rewrite minor number decoding. Now we have only three types of
object: subdisks, plexes and volumes.  The encoding for plexes and
subdisks no longer reflects the object to which they belong.  The
super devices are high-order volume numbers.  This gives vastly more
potential volumes (4 million instead of 256).

As a result of the minor number changes, split out the superdevice
handling into a separate function, vinum_super_ioctl.  This was most
of the code of vinumioctl.

attachobject: Improve error checking.
2003-05-01 01:30:59 +00:00
Greg Lehey
9488925d66 Use microtime, not getmicrotime, for timing debug entries.
init_drive: Rephrase error message text.
	    Remove dead code (inside #if 0).

Change name of find_drive_by_dev to the more descriptive
find_drive_by_name.

Tidy up comments.
2003-05-01 01:30:31 +00:00
Greg Lehey
d55f8bc42e Remove "to do" comments.
get_emppty_drive: Fix a day one bug with strcpy parameters.

Change name of find_drive_by_dev to the more descriptive
find_drive_by_name.

Rewrite minor number decoding.  Now we have only three types of
object: subdisks, plexes and volumes.  The encoding for plexes and
subdisks no longer reflects the object to which they belong.  The
super devices are high-order volume numbers.  This gives vastly more
potential volumes (4 million instead of 256).
2003-05-01 01:29:52 +00:00
Greg Lehey
47f9c49661 Rewrite minor number decoding. Now we have only three types of
object: subdisks, plexes and volumes.  The encoding for plexes and
subdisks no longer reflects the object to which they belong.  The
super devices are high-order volume numbers.  This gives vastly more
potential volumes (4 million instead of 256).

Remove an unnecessary goto.

vinumopen: Return EINVAL, not ENXIO, on an attempt to open a
referenced plex.
2003-05-01 01:28:42 +00:00
Maxim Sobolev
e9442e03ca Add support for IC Book Ironclad Pro/Lite 8-port cards.
Sponsired by:	IC Book Labs
MFC After:	2 weeks
2003-04-30 22:15:47 +00:00
Peter Wemm
8c027ecbba Eliminate a compiler warning with gcc3.3 on AMD64, where speed is
a 32 bit int which can never be > ULONG_MAX / 8.  Its an 'always true'
warning.
2003-04-30 21:39:28 +00:00
Mark Murray
51da11a27a Fix some easy, global, lint warnings. In most cases, this means
making some local variables static. In a couple of cases, this means
removing an unused variable.
2003-04-30 12:57:40 +00:00
Hidetoshi Shimokawa
98465499f8 Release devq before detach. 2003-04-30 10:32:32 +00:00
Hidetoshi Shimokawa
16dbbeec74 Set status to FWDEVINVAL if probe failed. 2003-04-30 10:20:24 +00:00
Marcel Moolenaar
214475d865 o Don't announce that the timer is good when in fact it isn't timing
at all (ie reads yield constant values). Display the width as the
   difference between max and min so that constant timers have width
   zero.
o  Get the address of the timer from the XPmTmrBlk field instead of
   the V1_PmTmrBlk field. The former is a generic address and can
   specify a memory mapped I/O address. Remove <machine/bus_pio.h>
   to account for this. The timer is now properly configured on
   machines with ACPI v2 tables, whether PIO or MEMIO. Note that
   the acpica code converts v1 tables into v2 tables so the address
   is always present in XPmTmrBlk.
o  Replace the TIMER_READ macro with a call to the read_counter()
   function and add a barrier to make sure that we observe proper
   ordering of the reads.
2003-04-30 05:27:01 +00:00
Warner Losh
1d2945d595 Fix tpyo in last commit.
Noticed by: kuriyama-san
2003-04-30 04:14:56 +00:00
Warner Losh
704d196541 Get rid of the redundant 'gone' field, and overload suspend instead.
Check for suspend before the device polling, rather than after it.
Check to see if the current thread owns the lock in ioctl and return
EBUSY if it does.

This advances the locking to the point that I can eject my fxp card 10
times in a row, but I agree with Jeff Hsu that we need to get the
network layer locking finished before chasing more of the races here
(actually, he doesn't think this set is worth it even).  There's a
number of races between FXP_LOCK in detach and all other users of
FXP_LOCK, and this gets back to the 'device with sleepers being
forcibly detached' problem as well...
2003-04-30 01:54:38 +00:00
Hidetoshi Shimokawa
45800373db Add missing crom_next() in the previous revision. 2003-04-29 23:40:04 +00:00
Nate Lawson
51773ddf47 Support functions for the new ACPI import.
* AcpiOsDerivePciId(): finds a bus number, given the slot/func and the
    acpi parse tree.
  * AcpiOsPredefinedOverride(): use the sysctl hw.acpi.os_name to
    override the value for _OS.

Ideas from:	takawata, jhb
Reviewed by:	takawata, marcel
Tested on:	i386, ia64
2003-04-29 18:50:34 +00:00
Hidetoshi Shimokawa
13bd86018b Set recv.len to zero if we get no response. 2003-04-29 15:02:34 +00:00
Hidetoshi Shimokawa
fd59632766 Get correct firmware/model information for multiple unit directories. 2003-04-29 15:01:01 +00:00
Hidetoshi Shimokawa
748ef1915a Fix indentation. 2003-04-29 14:05:17 +00:00
Alexander Kabaev
104a9b7e3e Deprecate machine/limits.h in favor of new sys/limits.h.
Change all in-tree consumers to include <sys/limits.h>

Discussed on:	standards@
Partially submitted by: Craig Rodrigues <rodrigc@attbi.com>
2003-04-29 13:36:06 +00:00
Hidetoshi Shimokawa
5364715a0e Move CSR definitions to iec*.h from firewirereg.h. 2003-04-29 13:27:13 +00:00
Hartmut Brandt
d2c96fc51f Add module data and version to the atm_subr and reference this info from the
(currently) only consumer (en).

Add a sysctl node hw.atm where the atm drivers will hook on their hardware
sysctl sub-trees.

Make atm_ifattach call if_attach and remove the corresponding call to if_attach
from en. Create atm_ifdetach and use that in en.

While the last change actually changes the interface this is not a problem in
practice because the only other consumer of this API is an older LANAI driver
on the net, that is not ready for current anyway.

Reviewed by:	-atm
2003-04-29 08:07:44 +00:00
Marcel Moolenaar
0ba311ef3a Keep syscons specific I/O functions internal/specific to syscons on
ia64 by defining them in terms of newbus. Add a static inline for
fillw(), which doesn't have anything to do with I/O.
It's still ugly, but now the ugliness can be removed from ia64
specific headers.
2003-04-29 07:06:44 +00:00
Warner Losh
c7611918c1 Fix typo on O2Micro devices names.
Submitted by: noda-san
2003-04-29 05:59:04 +00:00
Warner Losh
7634f08a29 (5) from last commit was omitted by mistake:
(5) Return immediately from fxp_intr() if gone is set.
2003-04-29 05:47:14 +00:00
Warner Losh
32cd7a9c00 Fix 5 bugs:
1) always call fxp_stop in fxp_detach.  Since we don't read from
	   the card, there's no need to carefully look at things with
	   bus_child_present.
	2) Call FXP_UNLOCK() before calling bus_teardown_intr to avoid
	   a possible deadlock reported by jhb.
	3) add gone to the softc.  Set it to true in detach.
	4) Return immediately if gone is true in fxp_ioctl
	5) Return immediately if gone is true in fxp_intr
2003-04-29 05:45:09 +00:00
Warner Losh
854cb5a41a Don't hold a driver lock across bus_teardown_intr. Jhb points out
that one cannot generally hold a lock and call bus_teardown_intr.
This is race free with wi_intr because bus_teardown_intr won't allow
wi_intr to be called after it returns.

# jeff hsu points out that there might be a race between this unlock
# and wi_start.  While that may be true also, it won't impact this commit.

Submitted by: jhb
2003-04-29 03:22:39 +00:00
Warner Losh
5878ce2cec Make IRQ shareable for the cardbus case too. 2003-04-28 18:50:59 +00:00
Søren Schmidt
ac9953bfdd Pull the pst driver out from under GAINT. 2003-04-28 08:10:27 +00:00
Scott Long
149af931ca Don't pass pointers to kernel data structures through 32-bit fields
as 64-bit architectures won't like this.  Use virtual array indexes
instead.  This *should* allow the driver to work on 64-bit platforms,
though it's still not endian clean.
2003-04-28 06:16:20 +00:00
Hidetoshi Shimokawa
70b400a813 Make compiled on RELEGN_4 2003-04-28 03:12:16 +00:00
Warner Losh
c14b840a2b Initialize error. 2003-04-27 23:44:05 +00:00
Warner Losh
a4da74c1d9 Make 2/3 of my symbol cards work again. The 3rd symbol card card has
firmware 1.50.12, but 2.20.1 and 3.10.4 work.  The 1.50.12 card gets
past doing dhclient, but hangs on transmit a little after the ip
address is set.  The 1.50.12 card has always been 'cranky' and Bill
Paul's tearing it apart at FreeBSD '99 hasn't helped.

sc_reset and sc_enable are subtlely different things.  sc_reset means
exactly "WI_CMD_INI has happened."  sc_enabled means "WI_CMD_ENABLE
has been sent to the card without a WI_CMD_DISABLE following."  This
is a little different than what they mean on NetBSD (where both of
these concepts are comingled).  NetBSD will try to only enable symbol
cards once, while FreeBSD only sends the WI_CMD_INI once.

Also, only try once to reset the card on a symbol.

This makes the lucent cards no worse than before, but apparently not
much better either.  I got fewer hangs in my testing than I have in
the past, but I don't know if it is statistically significant or not.
2003-04-27 15:56:05 +00:00
Sam Leffler
5adbdf5429 recognize the Sun Crypto 5821 and Crypto 1K cards;
they both use the Broadcom 5821

Submitted by:	Panagiotis Astithas
MFC after:	1 day
2003-04-27 04:26:22 +00:00
Warner Losh
7110005e4b Add generic OEM1 PRISM3 card.
Submitted by: mwlucas
2003-04-27 03:34:05 +00:00