Commit Graph

10517 Commits

Author SHA1 Message Date
David E. O'Brien
a55a017f42 Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones.
Requested by:	bde,imp
2003-12-08 07:54:15 +00:00
Don Lewis
55a3845131 The last argument to mtx_init() should be MTX_DEF, not 0. This is not a
functional change since MTX_DEF happens to be defined as 0.
2003-12-08 01:08:03 +00:00
Don Lewis
b01a62069f Correct usage of mtx_init() API. This is not a functional change since
the code happened to work because MTX_DEF and NULL are both defined as 0.

Reviewed by:    phk
2003-12-07 23:21:22 +00:00
Søren Schmidt
85dd785ec8 Try a little harder to catch when fixate finishes.
On the <QSI CD-RW/DVD-ROM SBW-242> that failed causing burncd to
wait forever...
2003-12-07 23:15:22 +00:00
Daniel Eischen
f850af3016 Don't call em_stop() from the watchdog since it requires the controller
mutex to be locked.  It is redundant since em_init() is called and this
correctly locks the mutex and calls em_stop().

5.2 release candidate since this can cause a panic if the watchdog
expires.

Tested by:	kuriyama
2003-12-07 06:50:04 +00:00
Warner Losh
05a463a03d Ooops. These are still used by the bktr driver. David O'Brien has
plans for dealing, but I'll let him deal.

Pointy hat to: imp@
2003-12-07 06:37:32 +00:00
Warner Losh
f7744c2d67 unifdef old interface support out to prevent false positives.
Suggested by: jeffr, obrien, and others
2003-12-07 05:17:13 +00:00
Warner Losh
65b4a1b917 Remote meteor driver. It hasn't compiled in over 3 years. If someone
makes it compile again, and can test it, we can restore the driver to
the tree.
2003-12-07 04:41:11 +00:00
Warner Losh
1da8b3b984 Now that we have the en(4) driver, we no longer need the hea driver.
Approved by: harti@
2003-12-07 04:27:08 +00:00
Warner Losh
6ee2f106aa The dgb driver is redundant with the digi driver in the tree. It uses
lots of old interfaces, and digi now supports all cards that dgb
supported.  The author of the driver says that this is no longer
necessary.

Approved by: babkin@
2003-12-07 04:18:52 +00:00
Warner Losh
29b4184577 Continue to remove drivers that don't compile and haven't compiled in
a long time: lmc The LAN Media Corp PCI WAN driver based on tulip.
This driver hasn't compiled for 3 years since the PCI compat shims
were removed, and Lan Media appears to have gone out of business.
These cards appear to be rare (a recent search of ebay had no hits).

Should someone wish to revive this driver, submitting patches to make
it compile plus a testing report will bring it back.
2003-12-07 04:05:19 +00:00
MIHIRA Sanpei Yoshiro
773c505f3c Add support for ELECOM/Laneed CardBus FastEtherner Card(LD-CBL/TXA)
Submitted by:	Masahiro Yamagishi <night@pluto.dti.ne.jp>
Approved by:	re (scottl)
2003-12-06 02:29:31 +00:00
Mathew Kanner
bc38932a58 Fix some locking violations by creating seperate mutex classes
for play and record channels.

Approved by:	seigo (mentor)
Approved by:	scottl (re)
2003-12-05 02:08:13 +00:00
Scott Long
21cbd69b19 Fix a potential problem with atapi-cam where an incorrect flag is passed
into the ata queueing layer.

Approved by:	re
2003-12-05 01:02:46 +00:00
John Baldwin
447a5fa113 Update this driver to be more module friendly:
- Dynamically allocate the cpu_softc[] array based on mp_maxid instead of
  using a statically sized array that depended on 'options SMP'.
- Use mp_maxid rather than MAXCPU when walking all the CPUs looking for a
  match.
- Always call smp_rendezvous() since UP kernels now provide this.
- Use mp_ncpus rather than cpu_ndevices when determining if we need to
  disable C3 for SMP machines.

Approved by:	re (rwatson)
Reviewed by:	njl
2003-12-03 20:27:48 +00:00
Scott Long
c5a8036c3d Temporary workaround for aac_cam to deal with CAM requiring Giant. This
should fix the panics on boot with newer Adaptec RAID cards.

Approved by:	re (rwatson)
2003-12-03 15:42:12 +00:00
Søren Schmidt
b4485f7a3c Fix for the missing slave problem.
Approved by: re@
2003-12-03 15:32:53 +00:00
Søren Schmidt
019446db3a Fix modesetting on ISA only systems.
Approved by: re@
2003-12-03 13:40:26 +00:00
Warner Losh
88afb90f3c Updated cx driver commit part 1: bring in the new kernel driver.
This is the vastly updated cx drvier from Roman Kurakin <rik@cronyx.ru>
who has been patiently waiting for this update for sometime.

The driver is mostly a rewrite from the version we have in the tree.
While some similarities remain, losing the little history that the old
driver has is not a big loss, and the re@ felt it was easier this way (less
error prone).

The userland parts of this update will be committed shortly.

The driver is not connected to the build yet.  I want to make sure I
don't break any platform at any time, so I want to test that with
these files in the tree before I continue (on the off chance I'm
forgetting a file).

I changed the DEBUG macro to CX_DEBUG from the code that was submitted
(to not break when we go to building with opt_global.h after the
release), as well adding $FreeBSD$.

Submitted by: Roman Kurakin
Approved by: re@ <scottl>
2003-12-03 07:29:38 +00:00
Prafulla Deuskar
20109fa046 Use if_flags to check for IFF_POLLING instead of if_ipending.
Submitted by:	jroberson (Jeff Roberson)
Approved by:	re (scottl)
2003-12-02 22:13:08 +00:00
Bruce Evans
fb0ca10d0c Fixed some minor indentation bugs.
Approved by:	re (scottl)
2003-12-02 12:47:08 +00:00
Bruce Evans
933a354fe5 Fixed breakage of the pci case of the cy driver by the new interrupt
code.  Both the driver and the new code were wrong.  Driver interrupt
handlers are supposed to take "void *vsc" arg, but some including all
COMPAT_ISA drivers and the pci part of the cy driver want an "int unit"
arg.  They got this using bogus casts of function pointers which should
have kept working despite their bogusness.  However, the new interrupt
code doesn't honor requests to pass an arg of ((void *)0), so things
are very broken if the arg is actually a representation of unit 0.

The fix is to use a normal "void *vsc" arg for the pci case and a
wrapper for the COMPAT_ISA case (of the cy driver).  This cleans up
new-busification of the pci case but takes the COMPAT_ISA case a little
further from new-bus.  The corresponding bug for the COMPAT_ISA case
has already been fixed similarly using a wrapper in compat_isa.c and
we need another wrapper just to undo that.

Fixed some directly related style bugs (mainly by removing compatibility
cruft).

cy.c:
Fixed an indirectly related old bug in cyattach_common().  A wrong status
was returned in the unlikely event that malloc() failed.

Approved by:	re (scottl)
2003-12-02 12:36:00 +00:00
Paul Saab
a85e26c4bf After extensive QA cycles at 3ware, bring the driver in-line with all the
issues which they found and asked to be changed so 3ware can offcially
support the driver.

Summary of the most significant changes:

- TWE_OVERRIDE is no longer supported
- If twe_getparam failed, bogus data would be returned to the caller
- Cache the device unit in the twe_drive structure to aid debugging
- Add the 3ware driver version.
- Proper return error codes for many functions.
- Track the minimum queue length statistics
- 4.x compat: use the cached unit number from the twe_drive structure
  instead of the the cached si_drv2.  3ware found that after many loads
  and unloads that si_drv2 became corrupted.  This did not happen in
  -current.

Submitted by:	Vinod Kashyap (with modifications by me)
Approved by:	re (rwatson)
2003-12-02 07:57:20 +00:00
Warner Losh
51c3136508 Fix Lucent cards.
o Back out workaround for not resetting lucent cards more than once.  With
  these fixes, it appaers they are no longer necessary.
o Set wi_gone when the card goes awol: typically when we get 0xffff back from
  the card.  Also, don't interact with a card that's gone, so we fail in
  seconds rather than minutes.  Also reduce amount of time we wait to .5s
  in wi_cmd.
o clear wi_gone on ifconfig down to give some cards a chance after they wedge
  (this appears to unwedge one of my prism cards with old firmware).  ifconfig
  up will fail quickly enough if the card really is out to lunch.
o Add delay in wi_init of 100ms.
o wi_stop(ifp, 0->1) changes so that we clear sc_enabled so that we
  exit out of the interrupt routine by just acking the interrupt

Submitted by: iedowse
Approved by: re@ (scottl)

# after the freeze I'll fix some of the minor style issues that reviewers
# of this patch have told me about.
2003-12-02 04:59:59 +00:00
Don Lewis
da6f8233bc Use a mutex to synchronize the driver top and bottom halves instead of
using critcal_enter() and critical_exit() to attempt to replace spl*()
calls.  The critical section was calling selrecord(), which locks an
MTX_DEF mutex, which is not legal in a critical section.

Tested by: Stefan Ehmann <shoesoft@gmx.net> and "make universe"
Approved by: re (scottl)
2003-12-01 19:03:50 +00:00
Søren Schmidt
ccd50c4818 Fix ata-card.
The altio resource magic no longer worked probably due to other changes
in the kernel. Redo that part so it also fits better into ATAng.
Fix detach so it doesn't panic the system when a pccard device is
yanked.

Approved by: re@
2003-11-30 16:27:59 +00:00
Sam Leffler
d927d7ab84 correct typo in interrupt handling for the 2nd port of 2-port cards
Submitted by:	luigi
Reviewed by:	checking original openbsd code
Approved by:	re (scottl)
2003-11-29 19:33:01 +00:00
Sam Leffler
8cec0ab9a8 o track API change for HAL v0.9.6.1
o fix race condition when processing rx descriptors: because we use
  a self-linked descriptor at the end of the rx descriptor list to
  avoid rx overruns (which can easily happen for 5212 parts that enable
  PHY errors) we must carefully check that a descriptor is "done" by
  looking ahead to the next descriptor before believing the done bit
  in the current descriptor (this is all handled in the HAL since the
  rx descriptor format is chip-specific so we need to pass in two
  additional parameters--the physical address of the current descriptor
  and the virtual address of the next descriptor in the list)
o check copyout return status for SIOCGATHSTATS ioctl

Approved by:	re (scottl)
2003-11-29 01:23:59 +00:00
Søren Schmidt
b437f21e88 Workaround for errata on early versions of the sii3112.
Approved by: re@
2003-11-28 19:01:28 +00:00
Warner Losh
347934fa63 Sometimes cardbus attachments don't attach, so while we track down
this problem put these lines back in.  While they should be
unnecessary, they appear to be sometimes necessary.

Reviewed in concept: dfr
Approved by: re (scottl@)
2003-11-28 05:28:29 +00:00
Poul-Henning Kamp
9491306ad3 Improve semantics of the 'sequence' command to led(4) devices:
use lowercase for off and upper case for on.

Approved by:	re@
2003-11-27 20:23:32 +00:00
Mathew Kanner
8e2d74a486 Fix a panic due to holding a lock over calls to uiomove.
Pointed out by:	Artur Poplawski
Explained by:	Don Lewis (truckman)
Approved by:	tanimura (mentor)
Approved by:	scottl	(re)
2003-11-27 19:51:44 +00:00
Nate Lawson
cd1f3db9ba * If a processor's softc is NULL, use C1 since there is no ACPI
processor object for this CPU.  This occurs for logical CPUs which
  do not have an associated processor object (e.g., HTT).

Approved by:	re (rwatson)
2003-11-27 16:32:46 +00:00
Martin Blapp
7633e7f1a2 ServeRaid (at least 5i) didn't initialize correctly. To get
them working (cache, automatic rebuild and hotswap) the FFDC
info (First Failure Data Capture) on the adapter must be
initialised.

Logical drives in critical/degraded states weren't added to
the drive list. FreeBSD was not able to see a degraded array
after a reboot. Degraded drives are now also added to the drivelist
and the state of the logical drive is given at boottime.

The adapter type is detected from informations in nvram page 5
and displayed at boottime.

Change IPS_OS_FREEBSD definition from 10 to 8 according to IBM
specs.

Submitted by:   <Patrick Guelat> pgfb@imp.ch
Reviewed by:    mbr, scottl
Approved by:    re
2003-11-27 08:37:36 +00:00
Nate Lawson
b6426963c4 * Add acpi_pcpu_get_id(idx, *acpi_id, *cpu_id) which fetches the
idx'th present CPU with pc_acpi_id equal to *acpi_id.  If *acpi_id
  does not match that processor's pc_acpi_id, return the value for
  ProcId derived from the MADT in *acpi_id.  If pc_acpi_id is 0xffffffff,
  always override it with the value of *acpi_id.  Finally, return
  pc_cpuid in *cpu_id and use that as our primary key.

* Use pc_cpuid as our unique key because we know it is valid since
  MD code set it.  The values for ProcId in the ASL and MADT don't
  match up on some machines (!), forcing us to fall back to ordered
  probing in that case.

* Remove some #ifdef SMP since the refcount doesn't hurt performance
  and will be needed for dynamic _CST objects.  Only one #ifdef SMP
  (for smp_rendezvous) remains.

* Hook up SMP in the compile flags in the Makefile.

Tested by:	marcel, truckman
Approved by:	re (scottl)
2003-11-26 19:01:33 +00:00
Ian Dowse
5bc9164667 Write the correct value to `td_be' for the second and further
transfer descriptors when a large request needs to be split into
more than one 8k chunk. The bug was that the calculation did not
take into account the offset of the chunk within the overall request.
This is reported to fix crashes and data corruption on ohci
controllers.

Submitted by:	green
Approved by:	re
2003-11-25 02:23:29 +00:00
Søren Schmidt
bf0d5626ce Correct the former patch, I accidently committed the wrong version.
Approved by: re@
2003-11-24 14:54:41 +00:00
Søren Schmidt
61058204d5 Fix panic on certain failed configs.
Approved by: re@
2003-11-24 14:22:30 +00:00
Søren Schmidt
62104e9446 Be less noisy when GEOM probes around during boot if drive contains
invalid media (ie empty CD/DVD)

Approved by: re@
2003-11-24 14:20:19 +00:00
Greg Lehey
76ffeff6bd Initalize buffer headers correctly for current version of bio subsystem.
Not mentioned by: phk
Approved by:	  re (scottl)

This makes Vinum work again, at least in my testing.
2003-11-24 04:06:56 +00:00
Scott Long
8427f795da Fix vinum by correctly setting the b_offset bio filed when doing I/O.
Submitted by:	grog
2003-11-23 17:10:58 +00:00
Poul-Henning Kamp
7e31c3b7ea Avoid NULL pointer dereference.
Approved by:	re@
2003-11-23 10:22:51 +00:00
Søren Schmidt
c08809df49 Fix support for the cmd646 chip.
Spotted by: tmm
reviewed by: re@
2003-11-21 22:58:56 +00:00
John Baldwin
3500189b0e Fix a typo in my patches to support extended IRQ resources that broke the
type checking for _PRS for a link device's interrupt resources.

Approved by:	re (scottl)
2003-11-20 22:21:51 +00:00
John Baldwin
d784bc82f2 Try all of the possible interrupts for a link device when programming
boot-disabled devices instead of skipping the last interrupt.  This is
especially important for devices that only have one interrupt as this
bug was keeping any interrupt from being tried at all.

Reviewed by:	msmith
Approved by:	re (scottl)
2003-11-20 21:23:49 +00:00
Mark Murray
4e3a7a14d9 Fix a major faux pas of mine. I was causing 2 very bad things to
happen in interrupt context; 1) sleep locks, and 2) malloc/free
calls.

1) is fixed by using spin locks instead.

2) is fixed by preallocating a FIFO (implemented with a STAILQ)
   and using elements from this FIFO instead. This turns out
   to be rather fast.

OK'ed by:	re (scottl)
Thanks to:	peter, jhb, rwatson, jake
Apologies to:	*
2003-11-20 15:35:48 +00:00
Nate Lawson
56a70eadf5 * Add a DEVMETHOD for acpi so that child detach methods get called. Add
an acpi_cpu method for shutdown that disables entry to acpi_cpu_idle
  and then IPIs/waits for threads to exit.  This fixes a panic late in
  reboot in the SMP case.

* In the !SMP case, don't use the processor id filled out by the MADT
  since there can only be one processor.  This was causing a panic in
  acpi_cpu_idle if the id was 1 since the data was being dereferenced from
  cpu_softc[1] even though the actual data was in cpu_softc[0] (which is
  correct).

* Rework the initialization functions so that cpu_idle_hook is written
  late in the boot process.

* Make the P_BLK, P_BLK_LEN, and cpu_cx_count all softc-local variables.
  This will help SMP boxes that have _CST or multiple P_BLKs.  No such
  boxes are known at this time.

* Always allocate the C1 state, even if the P_BLK is invalid.  This means
  we will always take over idling if enabled.  Remove the value -1 as
  valid for cx_lowest since this is redundant with machdep.cpu_idle_hlt.

* Reduce locking for the throttle initialization case to around the write
  to the smi_cmd port.  Add disabled code to write the CST_CNT.  It will
  be enabled once _CST re-evaluation is tested (post 5.2R).

Thank you:	dfr, imp, jhb, marcel, peter
Tested by:	rwatson, Harald Schmalzbauer <h@schmalzbauer.de>
Approved by:	re (rwatson)
2003-11-19 20:27:06 +00:00
Poul-Henning Kamp
0eb1430969 Use the class->init() to hitch up preload devices, rather than rely on
the "old" SYSINIT.  This makes sure things happen in the right order.

XXX: md(4) needs to be fully geom-ified and in particluar /dev/md.ctl
should be abandonded for the GEOM OaM api.

Approved by:	re@
2003-11-18 18:19:26 +00:00
Søren Schmidt
f584b21960 Add support for the SiS964 ATA/SATA southbridge.
This could not have been done without the support from kuriyama.

Approved by: re@
2003-11-18 15:27:28 +00:00
Søren Schmidt
d7536ac93e Work around the problem that some CDROM drives might return different
TOC's for the same media!! that borks up GEOM.
Although this looks like bad HW the following patch removes the
chance for GEOM panic'ing.

Approved by: re@
2003-11-18 15:23:37 +00:00