Commit Graph

5844 Commits

Author SHA1 Message Date
Matt Jacob
56f7a63a7a Ansification of source. 2001-04-04 21:43:43 +00:00
Matt Jacob
534bd9fecb After loading f/w, for FC cards print out Firmware Attributes.
Redo establishment of default SCSI parameters whether or not
we've been compiled for target mode. Unfortunately, the Qlogic
f/w is confused so that if we set all targets to be 'safe' (i.e.,
narrow/async), it will also then report narrow, async if we're
contacted in target mode from that target (acting in initiator
role). D'oh!

Fix ISPCTL_TOGGLE_TMODE to correctly enable the right channel for
dual channel cards. Add some more opcodes. Fix a stupid NULL
pointer bug.
2001-04-04 21:42:59 +00:00
Orion Hodson
8b330062da Centralize DMA buffer configuration.
Simplify initialization and remove offending DMA channel resets there.
The resets trash whatever is pointed to DMA registers, but at cmi_attach()
time the DMA registers have not been initialized with valid addresses.

Reviewed by:	Cameron Grant <gandalf@vilnya.demon.co.uk>
2001-04-04 13:48:33 +00:00
Warner Losh
5ea63116b8 Doh! Last second change introduced two compile warnings. Fix them. 2001-04-04 06:05:46 +00:00
Warner Losh
840709e709 Try to INIT the cards up to 5 times in a row rather than just once.
It appears that some of the new PRISM2 cards need it.

Fail the probe if we fail to read the MAC address.

Fix a comment.

Delete the unload printf.  The bus system now prints this message.
2001-04-04 06:03:39 +00:00
Seigo Tanimura
6c2b22e90e Again initialize a mutex well, then lock it.
PR:		kern/26188
Submitted by:	Jim Bloom <bloom@acm.org>
2001-04-03 05:15:58 +00:00
Paul Saab
05ba6e6a36 Fix probing on the alpha. It still causes the alpha to panic during
attach.
2001-04-03 00:26:34 +00:00
John Baldwin
606e1d6816 Remove bogus block device major now that bdev majors are gone. 2001-04-02 23:36:36 +00:00
Nick Hibma
899a73c0a6 Regen. 2001-04-02 13:12:15 +00:00
Nick Hibma
d8ee57ce7d Add Agate Q-Drive.
Submitted by:	Ian Cartwright <ian351c@home.com>
2001-04-02 13:11:59 +00:00
Nick Hibma
59a42a13d5 Regen. 2001-04-02 13:02:36 +00:00
Nick Hibma
0a191eddb4 Sync with NetBSD usbdevs 2001-04-02 13:02:17 +00:00
Scott Long
0001afe2f5 Make an attempt to get the asr driver to compile on Alpha by fixing some i386
specific bogons.  Compile with -O0, as anything higher gives the compiler
a fit.  No idea if this driver will actually work on Alpha, though.
2001-04-01 08:33:01 +00:00
Alfred Perlstein
8cf6ffcf6d make code use strxxx() calls
Glanced at by: imp
2001-04-01 07:36:28 +00:00
Yoshihiro Takahashi
fb8a224ea1 Merged from sys/dev/aic/aic_isa.c revision 1.7. 2001-04-01 06:37:59 +00:00
Justin T. Gibbs
b5f51cd7b9 Change ahc_update_pending_scbs() so that it safe to be called
even if the controller is not paused.  This prevents SCB list
corruption that was introduced in the last checkin.
2001-04-01 00:00:09 +00:00
Jesper Skriver
a174ba729c Change the previous commit to be in style(9)
Reviewed by:	jhb
2001-03-30 16:05:50 +00:00
Bill Paul
5f4d50b544 Fix a couple style nits, no code changes. Turn one magic number into
a #defined constant, wrap a few long lines, etc... Also remove stupid
'all your base are belong to us' joke from comment that I don't really
care to see immortalized in the source tree.
2001-03-29 19:11:45 +00:00
Brian Feldman
a75c49591f Since -CURRENT requires module dependencies to actually be correct for
linking to work, have cue(4) depend on usb so it actually works.
2001-03-29 18:14:55 +00:00
Orion Hodson
417f47c4d5 - Added suspend/resume support.
- Added 4 speaker enable to initialization sequence.

- Removed delays between register pokes which appear to aggravate a
  problem this card has sampling at 44.1kHz.  With any form of delay,
  skew relative to system clock at 44.1kHz is usually in range 0-25%
  (now 0-3%).  No other rates exhibit this problem.

- Changed structs cmi_* to sc_*.

Approved by:    Cameron Grant <gandalf@vilnya.demon.co.uk>
2001-03-29 15:36:31 +00:00
Andrew Gallatin
6a5a4d0a80 fix a number of printf format string warnings inside DEBUG ifdefs 2001-03-29 15:05:08 +00:00
Jesper Skriver
6c00471f28 Fix building NEWCARD again, by including
sys/types.h and sys/lock.h in pccbb.c, as
jhb noted in rev 1.12 of src/share/man/man9/mutex.9
2001-03-29 10:23:45 +00:00
Justin T. Gibbs
b95de6dafd aic7770.c:
aic7xxx_pci.c:
	Enable board generation of interrupts only once our handler is
	in place and all other setup has occurred.

aic7xxx.c:
	More conversion of data types to ahc_* names.  tmode_tstate and
	tmode_lstate are the latest victims.

	Clean up the check condition path by branching early rather
	than indenting a giant block of code.

	Add support for target mode initiated sync negotiation.
	The code has been tested by forcing the feature on for
	all devices, but for the moment is left inaccesible until
	a decent mechanism for controlling the behavior is complete.
	Implementing this feature required the removal of the
	old "target message request" mechanism.  The old method
	required setting one of the 16 bit fields to initiate
	negotiation with a particular target.  This had the nice
	effect of being easy to change the request and have it
	effect the next command.  We now set the MK_MESSAGE bit
	on any new command when negotiation is required.  When
	the negotiation is successful, we walk through and clean
	up the bit on any pending commands.  Since we have to walk
	the commands to reset the SCSI syncrate values so no additional
	work is required.  The only drawback of this approach is that
	the negotiation is deferred until the next command is queued to
	the controller.  On the plus side, we regain two bytes of
	sequencer scratch ram and 6 sequencer instructions.

	When cleaning up a target mode instance, never remove the
	"master" target mode state object.  The master contains
	all of the saved SEEPROM settings that control things like
	transfer negotiations.  This data will be cloned as the
	defaults if a target mode instance is re-instantiated.

	Correct a bug in ahc_set_width().  We neglected to update
	the pending scbs to reflect the new parameters.  Since
	wide negotiation is almost always followed by sync
	negotiation it is doubtful that this had any real
	effect.

	When in the target role, don't complain about
	"Target Initiated" negotiation requests when an initiator
	negotiates with us.

	Defer enabling board interrupts until after ahc_intr_enable()
	is called.

	Pull all info that used to be in ahc_timeout for the FreeBSD
	OSM into ahc_dump_card_state().  This info should be printed
	out on all platforms.

aic7xxx.h:
	Add the SCB_AUTO_NEGOITATE scb flag.  This allows us to
	discern the reason the MK_MESSAGE flag is set in the hscb
	control byte.  We only want to clear MK_MESSAGE in
	ahc_update_pending_scbs() if the MK_MESSAGE was set due
	to an auto transfer negotiation.

	Add the auto_negotiate bitfield for each tstate so that
	behavior can be controlled for each of our enabled SCSI
	IDs.

	Use a bus interrupt handler vector in our softc rather
	than hard coding the PCI interrupt handler.  This makes
	it easier to build the different bus attachments to
	the aic7xxx driver as modules.

aic7xxx.reg:
	Remove the TARGET_MSG_REQUEST definition for sequencer ram.

aic7xxx.seq:
	Fix a few target mode bugs:

		o If MK_MESSAGE is set in an SCB, transition to
		  message in phase and notify the kernel so that
		  message delivery can occur.  This is currently
		  only used for target mode initiated transfer
		  negotiation.

		o Allow a continue target I/O to compile without
		  executing a status phase or disconnecting.  If
		  we have not been granted the disconnect privledge
		  but this transfer is larger than MAXPHYS, it may
		  take several CTIOs to get the job done.

	Remove the tests of the TARGET_MSG_REQUEST field in scratch ram.

aic7xxx_freebsd.c:
	Add support for CTIOs that don't disconnect.  We now defer
	the clearing of our pending target state until we see a
	CTIO for that device that has completed sucessfully.

	Be sure to return early if we are in a target only role
	and see an initiator only CCB type in our action routine.

	If a CTIO has the CAM_DIS_DISCONNECT flag set, propogate
	this flag to the SCB.  This flag has no effect if we've
	been asked to deliver status as well.  We will complete
	the command and release the bus in that case.

	Handle the new auto_negotiate field in the tstate correctly.

	Make sure that SCBs for "immediate" (i.e. to continue a non
	disconnected transaction) CTIO requests get a proper mapping
	in the SCB lookup table.  Without this, we'll complain when
	the transaction completes.

	Update ahc_timeout() to reflect the changes to ahc_dump_card_state().

aic7xxx_inline.h:
	Use ahc->bus_intr rather than ahc_pci_intr.
2001-03-29 00:36:35 +00:00
Peter Wemm
32533d5ff9 Regenerate correctly. 2001-03-29 00:06:16 +00:00
Peter Wemm
e665ecb55c Hint: usbdevs_data.h and usbdevs.h are marked:
* THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
Put the Epson 1240 scanner device in the correct place.
2001-03-29 00:05:51 +00:00
Poul-Henning Kamp
3f865320ba Small patch is required to the USB susbsystem to include support for
Epson Perfection 1240U scanner.

PR:		25565
Submitted by:	Martin Machacek <m@m3a.cz>
2001-03-28 17:58:31 +00:00
Peter Wemm
37c9e8eebd Typo fix. s/criticale_t/critical_t/ 2001-03-28 14:54:28 +00:00
Hellmuth Michaelis
b40cbf61a7 In case the driver runs on an HP NetRaid controller, attempt to properly
decode the BIOS and firmware version and announce the board as HP NetRaid.

This has been tested with a NetRaid 3si controller, the BIOS/firmware
printout should also work for other NetRaid controllers but the type
detection for other NetRaids (such as the 1si) will not work due to the
lack of hardware.

Reviewed by:	msmith
2001-03-28 14:11:15 +00:00
John Baldwin
f34fa851e0 Catch up to header include changes:
- <sys/mutex.h> now requires <sys/systm.h>
- <sys/mutex.h> and <sys/sx.h> now require <sys/lock.h>
2001-03-28 09:17:56 +00:00
Jonathan Lemon
e3768ebb1b Back out previous commit until I figure out a way to do it properly.
We really want to be able to say "auto NWAY", "limited NWAY", and
"no NWAY".  Unfortunately, this does not appear to be possible with
the current mediaopt structure.
2001-03-28 07:01:45 +00:00
Mark Murray
d2de224265 Fix nasty corruption problem where a 64bit variable was being used
(overflowed) to catch a 256bit result.

Hard work done by:	jhb
2001-03-28 06:27:42 +00:00
Alfred Perlstein
0d5b5df5cb Add support for the Addtron AWA100 PCI wireless card.
The AWA100 is a PCI board with a PLX 9052 chip that's used to talk to
the pccard inserted into the board.

Remove a redundant $FreeBSD while I'm here.
2001-03-28 05:05:05 +00:00
John Baldwin
0006681fe6 Switch from save/disable/restore_intr() to critical_enter/exit(). 2001-03-28 03:06:10 +00:00
Paul Saab
6b8b8c7fdc Last commit was broken.. It always prints '[CTRL-C to abort]'.
Move duplicate code for printing the status of the dump and checking
for abort into a separate function.

Pointy hat to:	me
2001-03-28 01:37:29 +00:00
Søren Schmidt
7acf4af808 Use PLAY_MSF instead of PLAY_BIG when doing audio play.
The fixes the problem of PLAY_BIG not being implemented on
some modern drives.

The problem now is that some old drives use BSD encoding
in the MSF case, which they dont tell, and which is also
not according to spec *sigh*. Hopefully there are not
too many of those still alive, or I hereby grant
license to kill the firmware writers that wrote the mess.
2001-03-27 10:22:50 +00:00
Paul Saab
f2a404d5a6 Change the dump routines to only abort if control-c is pressed.
If any other key is pressed, print a message stating that control-c
is how to abort.

Reviewed by:	peter
2001-03-27 06:24:08 +00:00
Kenneth D. Merry
3393f8daa3 Rewrite of the CAM error recovery code.
Some of the major changes include:

	- The SCSI error handling portion of cam_periph_error() has
	  been broken out into a number of subfunctions to better
	  modularize the code that handles the hierarchy of SCSI errors.
	  As a result, the code is now much easier to read.

	- String handling and error printing has been significantly
	  revamped.  We now use sbufs to do string formatting instead
	  of using printfs (for the kernel) and snprintf/strncat (for
	  userland) as before.

	  There is a new catchall error printing routine,
	  cam_error_print() and its string-based counterpart,
	  cam_error_string() that allow the kernel and userland
	  applications to pass in a CCB and have errors printed out
	  properly, whether or not they're SCSI errors.  Among other
	  things, this helped eliminate a fair amount of duplicate code
	  in camcontrol.

	  We now print out more information than before, including
	  the CAM status and SCSI status and the error recovery action
	  taken to remedy the problem.

	- sbufs are now available in userland, via libsbuf.  This
	  change was necessary since most of the error printing code
	  is shared between libcam and the kernel.

	- A new transfer settings interface is included in this checkin.
	  This code is #ifdef'ed out, and is primarily intended to aid
	  discussion with HBA driver authors on the final form the
	  interface should take.  There is example code in the ahc(4)
	  driver that implements the HBA driver side of the new
	  interface.  The new transfer settings code won't be enabled
	  until we're ready to switch all HBA drivers over to the new
	  interface.

src/Makefile.inc1,
lib/Makefile:		Add libsbuf.  It must be built before libcam,
			since libcam uses sbuf routines.

libcam/Makefile:	libcam now depends on libsbuf.

libsbuf/Makefile:	Add a makefile for libsbuf.  This pulls in the
			sbuf sources from sys/kern.

bsd.libnames.mk:	Add LIBSBUF.

camcontrol/Makefile:	Add -lsbuf.  Since camcontrol is statically
			linked, we can't depend on the dynamic linker
			to pull in libsbuf.

camcontrol.c:		Use cam_error_print() instead of checking for
			CAM_SCSI_STATUS_ERROR on every failed CCB.

sbuf.9:			Change the prototypes for sbuf_cat() and
			sbuf_cpy() so that the source string is now a
			const char *.  This is more in line wth the
			standard system string functions, and helps
			eliminate warnings when dealing with a const
			source buffer.

			Fix a typo.

cam.c:			Add description strings for the various CAM
			error status values, as well as routines to
			look up those strings.

			Add new cam_error_string() and
			cam_error_print() routines for userland and
			the kernel.

cam.h:			Add a new CAM flag, CAM_RETRY_SELTO.

			Add enumerated types for the various options
			available with cam_error_print() and
			cam_error_string().

cam_ccb.h:		Add new transfer negotiation structures/types.

			Change inq_len in the ccb_getdev structure to
			be "reserved".  This field has never been
			filled in, and will be removed when we next
			bump the CAM version.

cam_debug.h:		Fix typo.

cam_periph.c:		Modularize cam_periph_error().  The SCSI error
			handling part of cam_periph_error() is now
			in camperiphscsistatuserror() and
			camperiphscsisenseerror().

			In cam_periph_lock(), increase the reference
			count on the periph while we wait for our lock
			attempt to succeed so that the periph won't go
			away while we're sleeping.

cam_xpt.c:		Add new transfer negotiation code.  (ifdefed
			out)

			Add a new function, xpt_path_string().  This
			is a string/sbuf analog to xpt_print_path().

scsi_all.c:		Revamp string handing and error printing code.
			We now use sbufs for much of the string
			formatting code.  More of that code is shared
			between userland the kernel.

scsi_all.h:		Get rid of SS_TURSTART, it wasn't terribly
			useful in the first place.

			Add a new error action, SS_REQSENSE.  (Send a
			request sense and then retry the command.)
			This is useful when the controller hasn't
			performed autosense for some reason.

			Change the default actions around a bit.

scsi_cd.c,
scsi_da.c,
scsi_pt.c,
scsi_ses.c:		SF_RETRY_SELTO -> CAM_RETRY_SELTO.  Selection
			timeouts shouldn't be covered by a sense flag.

scsi_pass.[ch]:		SF_RETRY_SELTO -> CAM_RETRY_SELTO.

			Get rid of the last vestiges of a read/write
			interface.

libkern/bsearch.c,
sys/libkern.h,
conf/files:		Add bsearch.c, which is needed for some of the
			new table lookup routines.

aic7xxx_freebsd.c:	Define AHC_NEW_TRAN_SETTINGS if
			CAM_NEW_TRAN_CODE is defined.

sbuf.h,
subr_sbuf.c:		Add the appropriate #ifdefs so sbufs can
			compile and run in userland.

			Change sbuf_printf() to use vsnprintf()
			instead of kvprintf(), which is only available
			in the kernel.

			Change the source string for sbuf_cpy() and
			sbuf_cat() to be a const char *.

			Add __BEGIN_DECLS and __END_DECLS around
			function prototypes since they're now exported
			to userland.

kdump/mkioctls:		Include stdio.h before cam.h since cam.h now
			includes a function with a FILE * argument.

Submitted by:	gibbs (mostly)
Reviewed by:	jdp, marcel (libsbuf makefile changes)
Reviewed by:	des (sbuf changes)
Reviewed by:	ken
2001-03-27 05:45:52 +00:00
Alfred Perlstein
da1aa0fd06 limit the amount of retries when sending data to prevent lockups. 2001-03-27 05:03:49 +00:00
Poul-Henning Kamp
f83880518b Send the remains (such as I have located) of "block major numbers" to
the bit-bucket.
2001-03-26 12:41:29 +00:00
Cameron Grant
26799605fc fix whitespace bogons 2001-03-25 21:43:24 +00:00
Cameron Grant
35910bd13e release resources if one of the speculative probes in opti_detect() fails,
otherwise resource_list_alloc panics when opti_detect tries its next probe.
2001-03-25 19:09:06 +00:00
Cameron Grant
4e5f69d4dd the softc is not a mutex, don't try to lock it.
Submitted by:		George Reid <greid@ukug.uk.freebsd.org>
2001-03-25 18:56:48 +00:00
Peter Wemm
b7a441ca87 Remove some unused stuff 2001-03-25 07:21:04 +00:00
Mark Murray
41bc9751be Allow bog-standard ioctls through. There are really handled in
higher layers, but there needs to be a "no-error" return here.
2001-03-25 06:55:19 +00:00
Cameron Grant
66ef8af5b0 mega-commit.
this introduces a new buffering mechanism which results in dramatic
simplification of the channel manager.

as several structures have changed, we take the opportunity to move their
definitions into the source files where they are used, make them private and
de-typedef them.

the sound drivers are updated to use snd_setup_intr instead of
bus_setup_intr, and to comply with the de-typedefed structures.

the ac97, mixer and channel layers have been updated with finegrained
locking, as have some drivers- not all though.  the rest will follow soon.
2001-03-24 23:10:29 +00:00
Gerard Roudier
0a9619993d Add #if'ed support for the future option CAM_NEW_TRAN_CODE. 2001-03-24 21:11:31 +00:00
Cameron Grant
c78683be1f when writing to one of the setup registers, a 32-bit write is required.
this apparently fixes problems initialising certain es1371/es1373/ct5880
revisions.

Confirmed working by: Richard J Kuhns <rjk@grauel.com>
PR:		i386/25944
2001-03-24 20:36:59 +00:00
Søren Schmidt
312ec441cd Add bandaid to get ISA only systems to link. 2001-03-24 16:19:07 +00:00
Mark Murray
02880f27f4 Silence (harmless) warnings. 2001-03-24 08:38:42 +00:00
Cameron Grant
64738af72b add support for opti924 and opti930 chips
both should work in non-pnp mode, the 924 should also work in its rather
braindead pnp mode- it will adopt port 0x530 unless given hints due to it
starting up in soundblaster mode and thus not requesting a valid mss port
address.

Submitted by:	George Reid <greid@ukug.uk.freebsd.org>
2001-03-24 00:22:01 +00:00
Søren Schmidt
543ee068a7 Fix the problem with some drives not reporting back when the
are busy blanking and erasing CD-RW media.
This fixes burncd's premature returns from blanking/erasing
that caused trouble.
2001-03-23 20:55:28 +00:00
Archie Cobbs
53046c5fd5 A few fixes..
1 Make promiscuous mode work
    2 A few header additions
    3 Allow device config before IFF_UP

These were (respectively)...

Submitted by:	Allan Saddi <asaddi@philosophysw.com>
Submitted by:	Dave Cornejo <dave@dogwood.com>
Submitted by:	Doug Ambrisko <ambrisko@ambrisko.com>
Tested by:	David Wolfskill <dhw@whistle.com>
2001-03-23 17:46:32 +00:00
Cameron Grant
715082895a * power up the external amplifier
* after chip reset, reapply power settings
2001-03-23 16:39:01 +00:00
Warner Losh
a81186b108 Now that I have a pair of CreditCard Netwave Adapter, tweak the eject
case slightly to not print unload when the upper layers print
a message as well.
2001-03-23 08:00:04 +00:00
Alfred Perlstein
ea846c773d devfs convertion used VINUMRMINOR incorrectly (passing args in
backwards order)

Submitted by: Bernd Walter <ticso@mail.cicely.de>
2001-03-22 23:21:49 +00:00
Scott Long
157fbb2e83 Create /dev/afaN as a symlink to /dev/aacN. This allows the CLI tools from
Dell and HP to run.

Reviewed by:	msmith
2001-03-22 21:04:22 +00:00
Warner Losh
c33c1284cb First step towards making loadable modules independent of having
pccard in the kernel for those drivers with pccard attachments.  This
makes the compat layer a little larger by introducing some inlines,
but should almost make it possible to have independent attachments.
The pccard_match function are the only one left, which I will take
care of shortly.
2001-03-22 06:00:07 +00:00
Warner Losh
f55f5ee276 Sync to last changes. 2001-03-22 05:52:42 +00:00
Warner Losh
15c1a6aede Add zoom air 4000. 2001-03-22 05:51:58 +00:00
Warner Losh
2873ce752b Style(9) changes:
put parens around return (statements);
	Use ANSI funcitons only.
2001-03-22 05:41:20 +00:00
Cameron Grant
73770282cf add/correct a bunch of codec ids
Obtained from:	linux, alsa, various datasheets
2001-03-22 02:41:24 +00:00
Scott Long
d5fd2abf4f Back out rev 1.4. The advertised 64K limit on transfers only applies when
using 64bit S/G entries.  With this reverted, we are seeing >92MB/sec reads
and >42MB/sec writes on a RAID-5 container.
2001-03-21 21:53:09 +00:00
Søren Schmidt
0aef91a149 The size of the disk can't be gotten reliably with the read capacity
command, so use the info from the TOC instead.
2001-03-21 14:59:38 +00:00
Orion Hodson
50aac86c8a Change type of channel speed variable from "int" to "u_int32_t" to
avoid overflow when scaling playback rate.  Fixes 44.1k playback from
being 48k (I am deaf to this difference...).
2001-03-21 14:10:51 +00:00
Orion Hodson
bd01f3f982 Change ordering of SPDIF register pokes. SPDIF enable needs to be the
last poke in sequence.  Enabling SPDIF was coercing output rate to
48K, not good for 44.1K tracks.
2001-03-21 12:51:37 +00:00
Søren Schmidt
256d331f31 Set the device names as early as possible. 2001-03-21 11:49:07 +00:00
Søren Schmidt
68337c2c00 Handle the case where the last piece of a RAID0 (striped) disk is
not of interleave size.
2001-03-21 11:48:14 +00:00
Søren Schmidt
7ee5559aa7 Cleanup the diskerr messages a bit. 2001-03-21 11:46:15 +00:00
Søren Schmidt
7154fc7c7b Do not change/get mode on a nonexisting device. 2001-03-21 11:44:58 +00:00
Matt Jacob
b72b15696c For parallel SCSI, let us now do status with the final CTIO. For the 1080,
I was hanging after sending a xfer CTIO and a status CTIO for a non-discon
INQUIRY- the xfer CTIO was returned as completed OK, but the status CTIO
was dropped on the floor. All the fields looked good. I don't know why
it got dropped. But allowing status to go back with data xfer seemed to
work. I also noticed that with a non-disconnecting command that the
firmware handle in the ATIO is zero- this leads me to believe that the
f/w really can only handle one CTIO at a time in the discon case, and
it had no idea what to do with the second (status) CTIO.
2001-03-21 00:49:37 +00:00
Matt Jacob
290dc24b4d Check CT2_SENDSTATUS/CT_SENDSTATUS against cto->ct_flags, not
CAM_SEND_STATUS. Set a timeout of 2 seconds per CTIO. Make sure
that the 'real' tag value is being checked against- not the
one that also carries the firmware handle.
2001-03-21 00:46:44 +00:00
Coleman Kane
e65631e862 Update copyright info, and make some slight cosmetic changes. 2001-03-20 19:34:22 +00:00
Coleman Kane
85737cb250 Change Voodoo Graphics device ID to 0x0001121a so it gets probed. 2001-03-20 19:30:46 +00:00
Poul-Henning Kamp
53233f9499 Fix a reference to the "vn" driver in a warning message. 2001-03-20 12:31:53 +00:00
Justin T. Gibbs
27bbd0d3ef This is an MFC candidate.
In our idle loop, use an or instruction to set PRELOADEN rather
than rewriting the contents of DMAPARAMS to DFCNTRL.  The later
may re-enable the DMA engine if the idle loop is called to complete
the preload of at least one segment when a target disconnects on
an S/G segment boundary but before we have completed fetching the
next segment.  This correts a hang, usually in message out phase,
when this situation occurs.  This bug has been here for a long
time, so the situation is rare, but not impossible to reproduce.
It only affected Ultra2/U160 controllers.

Correct a few comments.

Extra Sanity. Make sure that SCSIEN is also turned off, along with
HDMAEN, at the end of the data phase.
2001-03-20 04:37:19 +00:00
Søren Schmidt
f74abb9b6e Try not to engage to ATA channels that are disabled by the BIOS. 2001-03-19 13:31:58 +00:00
Søren Schmidt
1ac2b9fe97 On open create all the CD physical track devices according to the
TOC read from the CD, instead of cloning them when asked to.
2001-03-19 12:02:36 +00:00
Søren Schmidt
895fd69a76 Only allow root to attach/detach/etc ATA/ATAPI devices. 2001-03-19 11:55:13 +00:00
Søren Schmidt
6eee1a1c12 Add sysctls for reading the tunables as suggested by des.
Minor cleanups plus checks of the ->active state.
Cosmetics.
2001-03-19 08:04:54 +00:00
Søren Schmidt
b5a5e99d51 Cleanup the alloc/release code a bit.
Fix length error on the bmio resource.

Fix the irq release code, zero out free'd irq.
2001-03-19 08:02:42 +00:00
Søren Schmidt
2149e3e372 Cosmetic changes. 2001-03-19 07:48:19 +00:00
Justin T. Gibbs
705581e102 This is an MFC candidate.
aic7xxx.c:
	Correct code that traverses the phase table.  A much too quick
	push to staticize this structure resulted in non-functional
	lookup code.  This corrects the printing of the phase where
	a timeout occurred.

aic7xxx.reg:
	Use FIFOQWDEMP as the name for bit 5 of DFSTATUS just like
	the Adaptec data books.

aic7xxx.seq:
	Refine the 2.1 PCI retry bug workaround for certain, non-ULTRA2,
	controllers.  When the DMA of an SCB completes, it can take
	some time for HDONE to come true after MREQPEN (PCI memory request
	pending) falls.  If HDONE never comes true, we are in the hung
	state and must manually drain the FIFO.  We used to test HDONE for
	3 clock cycles to detect this condition.  This works on all of the
	hardware I can personally test.  Some controllers were reported
	to take 4 clock cycles, so the last version of this code waited
	4 clock cycles.  This still didn't work for everyone.  To fix this,
	I've adjusted the work around so that even if the hardware hasn't
	hung, but we run the work-around code, the result is a long winded
	way to complete the transfer, rather than a hang.
2001-03-19 04:40:35 +00:00
Orion Hodson
dfe67249d2 pcm driver for S3 Sonicvibes chipset.
Reviewed by:	Cameron Grant
2001-03-19 00:26:41 +00:00
Ian Dowse
f7cbf2b00e Use a module name of 'if_lnc' in both the PCI and ISA sections of
the driver. Doing this breaks the ability to unload the unneeded
parts of the driver (e.g unload the PCI section when using an ISA
card), but currently ifconfig(8) expects an interface `XXX' to have
a driver name of `if_XXX'.

PR:		kern/25582
Submitted by:	Alexander N. Kabaev <kabaev@mail.ru>, imp (apparently
		Warner suggested a similar fix some time ago).
Reviewed by:	paul (who would prefer to see ifconfig changed instead)
2001-03-18 17:44:23 +00:00
Cameron Grant
c6c3b893e5 destroy child devices on detach to prevent ever-increasing numbers of
pcm/midi devices trying to attach if the module is repeatedly loaded and
unloaded.
2001-03-17 16:04:25 +00:00
Jonathan Lemon
469961321f Really fix NWAY negotiation for the 82553 PHY. Locking down the
media interface selection should not imply disabling NWAY negotiaton
as well.

Problem pointed out by: peter
2001-03-17 02:50:20 +00:00
Justin T. Gibbs
da4c1ce305 This is an MFC candidate.
Add the AAC_DEBUG option to enable debugging in the aac driver.

Correct a race condition in the interrupt handler where the
controller may queue a fib to a response queue after the driver
has serviced the queue but before the interrupt is cleared.
This could leave a completed fib stranded in the response queue
unless another I/O completed and generated another interrupt.

Reviewed by:	msmith
2001-03-17 00:12:15 +00:00
Kenneth D. Merry
76db0ab017 Fix a few things in the aic(4) driver:
- enable 10MHz (fast SCSI) operation on boards that support it.  (only
   aic6360 boards with fast SCSI enabled can do it)

 - bounds check sync periods and offsets passed in from the transport layer

 - tell the user which resource allocation failed (for the ISA probe) if we
   weren't able to allocate an IRQ, DRQ or I/O port.
2001-03-16 22:20:19 +00:00
Mike Smith
eeba0d1008 Fix a typo which would cause containers between 1GB and 2GB to have the wrong
geometry reported.

Submitted by:	mark tinguely <tinguely@web.cs.ndsu.NoDak.edu>
2001-03-16 21:43:32 +00:00
Cameron Grant
bd22a64c45 fix a typo preventing the second dma channel being released
use isa_dma_release when releasing dma channels
2001-03-16 21:04:14 +00:00
Cameron Grant
effbadb7eb don't leak memory allocated for feeders at module unload
kill the fake channel when unregistering
2001-03-16 20:58:44 +00:00
Jonathan Lemon
32de04d557 Enable some undocumented bits in the DP83840 PHY, which is needed
when using it with the Intel fxp driver.

Tested by: peter, Ollivier Robert <roberto@eurocontrol.fr>,
	   Peter Schultz <pete@jocose.org>
2001-03-16 14:17:02 +00:00
Warner Losh
fc0f791a64 Commit port of cnw driver from Hiroyuki Aizu-san. This driver
supports Xircom netwave series of cards.  I have one of these cards
(but am trying to find one or two to test with), but it compiles and
aizu-san says it works.

I don't know if this supports 802.11 or not.  I've seen conflicting
information on this.

Submitted by: Hiroyuki Aizu <aizu@jaist.ac.jp>
Obtained from: NetBSD
2001-03-16 07:25:42 +00:00
Søren Schmidt
a2dca80a1d Provide the interface to atacontrol and associated logic.
see atacontrol(8) for more.

Also the ATA_ENABLE_ATAPI_DMA, ATA_ENABLE_WC and ATA_ENABLE_TAGS
options are gone, use the tuneables listed in ata.4 instead from
the loader (this makes it possible to switch off DMA before the
driver has to touch the devices on broken hardware).
2001-03-15 15:36:25 +00:00
Peter Wemm
3e481a771a The serverworks OSB4 pci->isa bridge has the same mapping register at
offset 0x90 for the SMBus device as the PIIX4.
2001-03-15 06:51:45 +00:00
Jonathan Lemon
3bd07cfd43 Add some performance features to the fxp driver. If the chip is not
a 82557 (e.g.: a newer chip) then:

   + enable MWI, if the PCI configuration indicates the system supports it
   + enable usage of extended TxCB, for better performance
   + enable hardware flow control.  FC frames will be passed up to the
     host only if promiscuous mode is enabled.
2001-03-14 19:50:35 +00:00
Søren Schmidt
6c2cfc9203 Minor cleanup to the previous commit:
Print what devices went away and which arrived.

Avoid timeout loop on missing status.
2001-03-14 14:00:09 +00:00
Søren Schmidt
8fab4242e4 Add support for the IOMEGA Clik!
IOMEGA deserves a medal for making the most nonstandard ATAPI
devices, if they are ignorant or just not smart enough I don't
know, but somebody should help them out of their misery...
2001-03-14 12:12:46 +00:00
Søren Schmidt
8ea3ce2aac Refine the detach/attach code.
Proberly fail outstanding bio requests on devices that are detached.

This makes it possible to change between disk/cdrom/dvd/whathaveyou
in a notebook, just by suspending it, changing the device in the
bay (or what you model calls it), unsuspend and the ATA driver
will figure out what disappeared and properly fail those, and attach
any new devices found.
2001-03-14 12:05:44 +00:00
Seigo Tanimura
5ddde3e6fd - Do not touch the Giant.
Requested by:	jhb

- Initialize a mutex prior to locking it.

Spotted by:	dcs
2001-03-14 07:29:47 +00:00
Matt Jacob
b0bd9b71f2 Clean up usage- ct_reserved is really ct_syshandle now. 2001-03-14 04:14:58 +00:00
Matt Jacob
f5a4462713 First cut of target mode swizzling for non-little endian machines.
It's probably wrong but it's a start.
2001-03-14 04:14:22 +00:00
Matt Jacob
75f7d77928 Mote that how the pad bytes can be divided in half and used by either
the target mode code or outer layers.

Increase cd_tagval to be 32 bits since it will have to now carry 16
bits of parallel SCSI ATIO handle as well as a normal tag (if any).
2001-03-14 04:13:30 +00:00
Matt Jacob
e2ec5cf0f9 In order to save ourselves grief with the SUNPRO compiler under
Solaris (which, for reasons unknown to me, chokes on u_int16_t
as a typedef of unsigned short if used in a transitional (mixed K&R
and ANSI) way), we'll go the extra mile and fully ANSIfy things.
2001-03-14 04:11:56 +00:00
Cameron Grant
9a1ec7ebfd fix a panic triggerable by anyone with read/write access to the audio
devices.  opening /dev/{dsp,dspW,audio}0 and then opening a different device
from that list and closing it resulted in a panic when any operation is
performed on the first fd.

we prevent this happening by denying the second open unless it uses the same
minor device as the first.

PR:		kern/25519
2001-03-13 18:43:22 +00:00
Andrey A. Chernov
807ef2d03f Multiply empty lines pasted as single line, fix it 2001-03-13 10:23:01 +00:00
Poul-Henning Kamp
0c8834cea6 Fix a race condition in the transmit path caused by the controller
caching a bit more than we were told initially.

More statistics gathering as well.
2001-03-13 09:29:37 +00:00
Peter Wemm
e793f3a0e0 By convention, the moduledata is static unless there is a reason for it
to not be.
2001-03-13 05:55:43 +00:00
Jonathan Lemon
68311a93fb Fix a whitespace bogon.
Pointed out by:  ps
2001-03-12 21:42:45 +00:00
Jonathan Lemon
f7788e8e9f Convert the fxp driver to miibus, which involves ripping out the PHY
logic and media bits.  Support for Intel PHYs can now be found in
dev/mii/inphy.c.

Clean up the driver, and add various 82558 and 82559 specific bits.
2001-03-12 21:30:52 +00:00
Assar Westerlund
e4b3e35ff0 change the default mode from adhoc to bss (infrastructure)
Reviewed by:	Brooks Davis <brooks@one-eyed-alien.net>
2001-03-12 06:13:39 +00:00
Assar Westerlund
fd1d7a8a15 change default from adhoc mode to BSS (infrastructure) 2001-03-12 04:49:50 +00:00
Jonathan Lemon
83a2d3997e Add drivers for Intel 82553 and 82555 PHYs. 2001-03-12 02:41:57 +00:00
Jonathan Lemon
c49993ab73 Regenerate. 2001-03-12 02:27:58 +00:00
Jonathan Lemon
5a3f7e2c9b Add some definitions for Intel 82553 PHYs 2001-03-12 02:27:10 +00:00
Andrey A. Chernov
74f62e12aa Don't require that mouse cursor must be visible before mouse paste.
Paste always happens to current _text_ cursor position independently of
mouse cursor position in any case and old variant force user to press
mouse paste button _two_ times if mouse cursor is invisible.
2001-03-12 01:15:11 +00:00
Andrey A. Chernov
86f7cedfda Update default keyboard (PREV, PASTE) 2001-03-12 00:00:22 +00:00
Andrey A. Chernov
4629b5e0fb Implement keyboard paste
PR:		25499
Submitted by:	Gaspar Chilingarov <nm@web.am>
2001-03-11 22:51:05 +00:00
Justin T. Gibbs
6fb77fef4d This is an MFC candidate.
ahc_eisa.c:
	Change aic7770_map_int to take an additional irq parameter.
	Although we can get the irq from the eisa dev under FreeBSD,
	we can't do this under linux, so the OSM interface must supply
	this.

ahc_pci.c:
	Move ahc_power_state_change() to the OSM.  This allows us to
	use a platform supplied function that does the same thing.
	-current will move to the FreeBSD native API in the near
	future.

aic7770.c:
	Sync up with core changes to support Linux EISA.

	We now store a 2 bit primary channel number rather
	than a bit flag that only allows b to be the primary
	channel.   Adjust for this change.

aic7xxx.c:
	Namespace and staticization cleanup.  All exported symbols
	use an "ahc_" prefix to avoid collisions with other modules.

	Correct a logic bug that prevented us from dropping
	ATN during some exceptional conditions during message
	processing.

	Take advantage of a new flag managed by the sequencer
	that indicates if an SCB fetch is in progress.  If so,
	the currently selected SCB needs to be returned to the
	free list to prevent an SCB leak.  This leak is a rarity
	and would only occur if a bus reset or timeout resulting
	in a bus reset occurred in the middle of an SCB fetch.

	Don't attempt to perform ULTRA transfers on ultra capable
	adapters missing the external precision resistor required
	for ultra speeds.  I've never encountered an adapter
	configured this way, but better safe than sorry.

        Handle the case of 5MHz user sync rate set as "0" instead of 0x1c
        in scratch ram.

        If we lookup a period of 0 in our table (async), clear the scsi offset.

aic7xxx.h:
	Adjust for the primary channel being represented as
	a 2 bit integer in the flags member of the ahc softc.

	Cleanup the flags definitions so that comment blocks are
	not cramped.

	Update seeprom definitions to correctly reflect the fact
	that the primary channel is represented as a 2 bit integer.

	Add AHC_ULTRA_DIASABLED softc flag to denote controllers
	missing the external precision resistor.

aic7xxx.reg:
	Add DFCACHETH to the definition of DFSTATUS for completness sake.

	Add SEQ_FLAGS2 which currently only contains the SCB_DMA
	(SCB DMA in progress) flag.

aic7xxx.seq:
	Correct a problem when one lun has a disconnected untagged
	transaction and another lun has disconnected tagged transactions.
	Just because an entry is found in the untagged table doesn't
	mean that it will match.  If the match on the lun fails, cleanup
	the SCB (return it to the disconnected list or free it), and snoop
	for a tag message.  Before this change, we reported an unsolicited
	reselection.  This bug was introduced about a month ago during an
	overly aggressive optimization pass on the reselection code.

	When cleaning up an SCB, we can't just blindly free the SCB.  In
	the paging case, if the SCB came off of the disconnected list, its
	state may never have been updated in host memory.  So, check the
	disconnected bit in SCB_CONTROL and return the SCB to the disconnected
	list if appropriate.

	Manage the SCB_DMA flag of SEQ_FLAGS2.

	More carefully shutdown the S/G dma engine in all cases by using
	a subroutine.  Supposedly not doing this can cause an arbiter hang
	on some ULTRA2 chips.

	Formatting cleanup.

	On some chips, at least the aic7856, the transition from
	MREQPEND to HDONE can take a full 4 clock cycles.  Test
	HDONE one more time to avoid this race.  We only want our
	FIFO hung recovery code to execute when the engine is
	really hung.

aic7xxx_93cx6.c:
	Sync perforce ids.

aic7xxx_freebsd.c:
	Adjust for the primary channel being a 2 bit integer
	rather than a flag for 'B' channel being the primary.

	Namespace cleanup.

	Unpause the sequencer in one error recovery path that
	neglected to do so.  This could have caused us to perform
	a bus reset when a recovery message might have otherwise been
	successful.

aic7xxx_freebsd.h:
	Use AHC_PCI_CONFIG for controlling compilation of PCI
	support consistently throughout the driver.

	Move ahc_power_state_change() to OSM.

aic7xxx_inline.h
	Namespace cleanup.

	Adjust our interrupt handler so it will work in the edge
	interrupt case.  We must process all interrupt sources
	when the interrupt fires or risk not ever getting an
	interrupt again.  This involves marking the fact
	that we are relying on an edge interrupt in ahc->flags
	and checking for this condition in addition to the
	AHC_ALL_INTERRUPTS flag.  This fixes hangs on the
	284X and any other aic7770 installation where level
	interrupts are not available.

aic7xxx_pci.c:
	Move the powerstate manipulation code into the OSM.  Several
	OSes now provide this functionality natively.

	Take another shot at using the data stored in scratch ram
	if the SCB2 signature is correct and no SEEPROM data is
	available.  In the past this failed if external SCB ram
	was configured because the memory port was locked.  We
	now release the memory port prior to testing the values
	in SCB2 and re-acquire it prior to doing termination control.

	Adjust for new 2 bit primary channel setting.

	Trust the STPWLEVEL setting on v 3.X BIOSes too.

	Configure any 785X ID in the same fashion and assume
	that any device with a rev id of 1 or higher has the
	PCI 2.1 retry bug.
2001-03-11 06:34:17 +00:00
Mark Murray
02c986ab54 Very large makeover of the /dev/random driver.
o Separate the kernel stuff from the Yarrow algorithm. Yarrow is now
  well contained in one source file and one header.

o Replace the Blowfish-based crypto routines with Rijndael-based ones.
  (Rijndael is the new AES algorithm). The huge improvement in
  Rijndael's key-agility over Blowfish means that this is an
  extremely dramatic improvement in speed, and makes a heck of
  a difference in its (lack of) CPU load.

o Clean up the sysctl's. At BDE's prompting, I have gone back to
  static sysctls.

o Bug fixes. The streamlining of the crypto stuff enabled me to
  find and fix some bugs. DES also found a bug in the reseed routine
  which is fixed.

o Change the way reseeds clear "used" entropy. Previously, only the
  source(s) that caused a reseed were cleared. Now all sources in the
  relevant pool(s) are cleared.

o Code tidy-up. Mostly to make it (nearly) 80-column compliant.
2001-03-10 12:51:55 +00:00
Matt Jacob
b42cba33a3 Fix a botch where we wrote the year register with > 2 digits (and
then knocked the extra digits off). Blegh. Update the comment and
adjustment method reading the chip clock year register to note that
anything less than 70 means we're past the year 2000.
2001-03-09 20:39:02 +00:00
Poul-Henning Kamp
a3e862d902 Remove vn(4) driver. 2001-03-09 20:10:35 +00:00
Poul-Henning Kamp
0ac6032373 Use a more BIOS friendly geometry.
Submitted by:	joe
2001-03-09 20:06:30 +00:00
Bill Paul
73e89fa2d4 Remember to actually program the MAC address into the unicast filter
in vr_init(). The VIA Rhine chip happens to be able to automatically
read its station address from the EEPROM automatically when reset,
so you don't need to program the filter if you want to keep using the
factory default address, but if you want to change it with "ifconfig vr0
ether xx:xx:xx:xx:xx:xx" then we need to manually set it in the init
routine.
2001-03-07 18:52:22 +00:00
Mitsuru IWASAKI
c30382df80 Bring our local hack for wakeup back from
sys/contrib/dev/acpica/Subsystem/Hardware/Attic/hwxface.c to the proper
location after AcpiEnterSleepState().

 - Wait for the WAK_STS bit
 - Evaluate the _WAK method and check result code
2001-03-07 15:22:14 +00:00
MIHIRA Sanpei Yoshiro
6573bc0b37 Add GVC1601 - Rockwell V.34 Plug & Play Modem
PR:		kern/25204
Submitted by:	Victor Ivanov <v0rbiz@icon.bg>
2001-03-07 14:27:56 +00:00
MIHIRA Sanpei Yoshiro
ab410acc0a Add IOD0081 - I-O DATA DEVICE,INC. IFML-560
PR:		kern/25173
Submitted by:	Yohsuke Fujikawa <yohsuke@mx2.nisiq.net>
2001-03-07 14:19:55 +00:00
Scott Long
8ae73164ab Set si_iosize_max to 64K, even though the adapter seems to be able to do more.
This puts us safely in line with Adaptec documentation and shouldn't really
affect anything.

MFC candidate for 4.3
2001-03-07 08:37:49 +00:00
John Baldwin
5493ca946e - Lock the process while sending it a signal.
- Attempt to define empty PROC_LOCK/UNLOCK when needed to help keep
  this driver portable.
2001-03-07 03:42:42 +00:00
John Baldwin
19eb87d22a Grab the process lock while calling psignal and before calling psignal. 2001-03-07 03:37:06 +00:00
Søren Schmidt
331c488d69 Split out the ata probes in seperate files for each bus type. 2001-03-06 21:43:46 +00:00
John Baldwin
cf0a305e5b Indent the comment about the Alpha palette evilness correctly.
Noticed by:	bde
2001-03-06 20:36:06 +00:00
Søren Schmidt
e0db7375ba Cosmetic change to the probe printf's 2001-03-06 09:42:46 +00:00
John Baldwin
b67cb27739 #if 0 out a variable only used in #if 0'd code to quiet a warning. 2001-03-06 03:07:58 +00:00
Andrey A. Chernov
55cafc98c5 Fix longstanding mouse cursor bug: blinking and eating all CPU while near text
cursor.
The reason is: mouse cursor goes into hide/visible loop while text cursor even
not moved.

PR:		25536
Submitted by:	David Xu <davidx@viasoft.com.cn>
2001-03-06 00:02:47 +00:00
John Baldwin
329292029c The SRM console gets the red and blue attributes backwards in the VGA
palette.  As a result, the colors on the video console can look rather
weird.  For example, sysinstall on the alpha has a read background.  We
can work around this partially by remapping the colors used by syscons for
the ANSI color escape sequences.  Note that screen savers and anything that
sets the colors explicitly will still get incorrect colors, but programs
such as sysinstall will now use the correct colors.  A more correct fix
would be to actually fix the VGA palette on boot by either swapping all
the red and blue attributes or by hardcoding a standard palette and
overwriting the entire palette.

Requested by:	gallatin
Obtained from:	NetBSD
2001-03-05 22:43:39 +00:00
Cameron Grant
86c1b69bbb increase timeouts for ad_wait_init() 2001-03-05 17:59:36 +00:00
Cameron Grant
415dc6874f MFS: don't ignore the result of mixer_init() 2001-03-05 17:51:28 +00:00
Cameron Grant
1c46beb55c only mess with the power state on 5.x 2001-03-05 17:30:43 +00:00
Cameron Grant
a0585a78aa MFS: add kobj.h to reduce diffs from -stable 2001-03-05 16:47:35 +00:00
Cameron Grant
96aa9dc9e1 MFS: don't pagefault in sndbuf_clear 2001-03-05 16:45:38 +00:00
Cameron Grant
b3ada620e8 MFS: #ifdef dynamic sysctl stuff to reduce diffs from -stable 2001-03-05 16:43:43 +00:00
Cameron Grant
00d6c0c690 MFS: add '# KOBJ' as the first line of each .m file to reduce diffs from
-stable
2001-03-05 16:42:06 +00:00
Cameron Grant
dec507e8f7 enable per-device sysctls unconditionally 2001-03-05 15:58:05 +00:00
Cameron Grant
a983d57528 nuke the splstack stuff, snd_mtx* will now be no-ops on 4.x 2001-03-05 15:49:42 +00:00
Peter Wemm
3eca04a56b Add an AUE device ID: USB_PRODUCT_MELCO_LUATX5
Submitted by:  Yoshihiko SARUMARU <mistral@imasy.or.jp>
2001-03-05 02:28:58 +00:00
Duncan Barclay
a6a0d91dba pkh's TAILQ changes to if_mutliaddrs missed a counting loop. 2001-03-04 20:56:45 +00:00
Matt Jacob
d8d5f2adc5 more 32 to 16 bit handle conversions 2001-03-04 18:42:51 +00:00
Matt Jacob
24d52eb7b5 More 32 to 16 bit handle stuff. Roll core minor version. 2001-03-04 18:42:23 +00:00
Matt Jacob
3bfa867765 Remove a superfluous newline in a string (isp_prt adds this).
Fix a missed conversion of 32 to 16 bit handles.
2001-03-04 18:41:23 +00:00
Mark Murray
3c36743e2d Harvest interrupt entropy off the floppy disk controller. 2001-03-03 14:53:50 +00:00
Mark Murray
61e934f038 Take down a comment that is no longer true.
/dev/random is ready for prime time!
2001-03-03 14:35:01 +00:00
Warner Losh
f2fdbb57ca Add support for Dlink DL10022 to the ed driver. This is a mii part
bolted to a ne-2000 chip.  This is necessary for the NetGear FA-410TX
and other cards.

This also requires you add mii to your kernel if you have an ed driver
configured.

This code will result in a couple of timeout messages for ed on the
impacted cards.  Additional work will be needed, but this does work
right now, and many people need these cards.

Submitted by: Ian Dowse <iedowse@maths.tcd.ie>
2001-03-03 08:31:37 +00:00
Matt Jacob
5f5aafe1fc Switch to using 16 bit handles instead of 32 bit handles.
This is a pretty invasive change, but there are three good
reasons to do this:

1. We'll never have > 16 bits of handle.
2. We can (eventually) enable the RIO (Reduced Interrupt Operation)
bits which return multiple completing 16 bit handles in mailbox
registers.
3. The !)$*)$*~)@$*~)$* Qlogic target mode for parallel SCSI spec
changed such that at_reserved (which was 32 bits) was split into
two pieces- and one of which was a 16 bit handle id that functions
like the at_rxid for Fibre Channel (a tag for the f/w to correlate
CTIOs with a particular command). Since we had to muck with that
and this changed the whole handler architecture, we might as well...

Propagate new at_handle on through int ct_fwhandle. Follow
implications of changing to 16 bit handles.

These above changes at least get Qlogic 1040 cards working in target
mode again. 1080/12160 cards don't work yet.

In isp.c:
Prepare for doing all loop management in outer layers.
2001-03-02 06:28:55 +00:00
Matt Jacob
715ec7e9a7 Fix isp_print_qentry to print all four lines- it's been broken for months. 2001-03-02 04:48:41 +00:00
Ian Dowse
783e9b1a7a There were a few changes missed when this file was converted to
newbus in revision 1.19. As a result, lnc was, I believe, broken
for all PCI cards. The softc fields `lnc_btag' and `lnc_bhandle'
were not initialised, `rap', `rdp' and `bdp' were initialised to
the wrong values, and the size of the DMA ring memory was calculated
incorrectly.

Paul Richards has further cleanups in the pipeline, but this at
least is enough to make the driver usable with VMware.

Approved by:	paul
2001-03-02 00:40:06 +00:00
Mark Murray
ed34d0ade2 Turn on interrupt-entropy harvesting for all/any mass storage devices
I could find. I have no doubt missed a couple.

Interrupt entropy harvesting is still conditional on the
kern.random.sys.harvest_interrupt sysctl.
2001-03-01 17:09:09 +00:00
Matt Jacob
6e5c5328c4 Eliminate the use of the getenv_int stuff we'd been using (with a bitmap
for selecting unit). Instead, use the resource hints mechanism.

One unfortunate situation here is that there is no resource_quad_value
function- which is what I needed for WWN boot time replacement. Worse-
you can't store the hint as just plain

hint.isp.0.nodewwn="0x50000000aaaa0001"

because this gets interpreted as an int- incorrectly because it can't
be converted to an int. I can't even get this as a string. To work
around this particular case for nodewwn && portwwn setting, this
rather grotesque form will be used:

hint.isp.0.nodewwn="w50000000aaaa0001"
hint.isp.0.portwwn="w50000000aaaa0002"

At the same time, if we have no hinted WWN, set the default WWN (which, btw,
gets overridden if the card has valid NVRAM, which is usual) to
0x400000007F000009ull (which translates to NAA == IPv4, 127.0.0.9).

Eliminate more printf's and replace them either with device_printf or
isp_prt calls.
2001-03-01 02:21:36 +00:00
Matt Jacob
c9a6d60b09 Go to a default port and default node wwn model. Eliminate isp_name
and isp_unit and just store the device_t, fer gosh sakes.... Include
sys/bus.h for use by isp_pci.c.
2001-03-01 02:15:58 +00:00
Matt Jacob
3c75bb14be Finally eliminate as many of the printf calls as possible (still leaving
ones where we have a CAM path) and replacing them with calls to isp_prt.,

Eliminate isp_unit references- we no longer have an isp_unit- we now
have an isp_dev that device_get_unit can work with.
2001-03-01 02:14:54 +00:00
Peter Wemm
9eb13b3914 Slightly reimplement some recently added helper functions as methods, so
that drivers are not reaching into the internals of the pci bus.  There
are no driver changes, the public interface is the same.
2001-02-27 23:13:20 +00:00
Matt Jacob
2a05a4eb2c A better mousetrap: use device hints, as in:
hint.fxp.0.prefer_iomap="1"

to set IO vs. Memory space mapping.
2001-02-27 22:57:32 +00:00
Scott Long
ea0e6ecfe9 Don't re-init the mixer on resume. This keeps the channel volumes from
being trashed when you suspend, though this may need to be revisited if we
ever get suspend-to-disk implememted.
2001-02-27 18:40:07 +00:00
Julian Elischer
e72bf8707b Remove warnings.. seems to compile as a module now too. 2001-02-27 17:52:49 +00:00
Julian Elischer
ae19fe648c Catch up with rwatsons ucred changes. 2001-02-27 17:43:53 +00:00
Julian Elischer
737a128622 Do it right this time. Give it a better name and place
CVSrepo deletion of the previous attempt will be requested:

--original message--
Add the 'virtual nulmodem driver'
Particularly useful for debuging kernels using vmware.

If your name is Bruce evans and you are a WIZ at tty interfaces,
then you should probably rip this to shreds and offer lots of suggestions and
patches. I've been using this since 4.0-CURRENT and it's never caused
problems but I'm sure I got something wrong. This is similar to the pty/cty
device driver except that both sides are ttys. Even minor numbers
are side A and odd minor numbers are side B.
Work needs to be done regarding what happens to the other side when you
close a node.

to use with vmware, configure vmware to redirect COM2 out to side A of one
of these and boot a kernel with teh gdb remote port set to sio1.
AFTER dropping into the gdb kernel debugger in your test kernel,
fire up gdb with it's remote port pointing at the appropriate side B.

To catch all console output, you can boot the vmware kernel with a serial
console, (COM1) similarly redirected to a nulmodem, and use 'tip' to observe it.

This is practically unaltered since pre 4.0 days except for
changes made along the way needed to make it compile, so any suggestions
or offers of total rewrites will be listenned to :-)
2001-02-27 16:39:54 +00:00
Cameron Grant
1b0dabf0c0 Add speaker volume adjusting support
Submitted by:	Tai-hwa Liang <avatar@mmlab.cse.yzu.edu.tw>
PR:		i386/21452
2001-02-27 12:44:31 +00:00
Yoshihiro Takahashi
bedee18193 Added another wd33c93 based SCSI card driver which replaces the bs driver.
Now, default is still bs.

Submitted by:	nyan and non.
Obtained from:	NetBSD/pc98
2001-02-27 12:34:01 +00:00
Cameron Grant
37209180a5 add functions for sound drivers to use for locking and setting up interrupt
handlers.  these are not yet used, but will allow compatibility for driver
modules from 5.x to 4.x.
2001-02-27 07:45:09 +00:00
Cameron Grant
82db23e2af MFS: 4.x/5.x compatibility #ifdefs 2001-02-27 07:01:49 +00:00
Cameron Grant
041e207dec MFS: 4.x/5.x compatibility #defines 2001-02-27 06:58:55 +00:00
Peter Wemm
003223c276 Disable the mutex locking calls. These do not work in their present form
as the code calls the usb stack (which can sleep) while holding the driver
lock.  This leads to a deadlock.
2001-02-27 01:05:25 +00:00
Matt Jacob
b0a3ba7e28 Fix at2_entry_t to reflect what the firmware actually writes (instead
of just deriving from SCSI at_entry_t). In this case, there is no
'suggested sense' for FC cards.
2001-02-27 00:14:39 +00:00
Jonathan Lemon
55d782fcc3 Add crashdump support.
Tested by:	ps
2001-02-26 22:25:30 +00:00
John Baldwin
68960924fe Properly protect the parameters to the EC_{GET,SET}_{DATA,CSR} macros with
parens.
2001-02-26 20:39:28 +00:00
John Baldwin
ee785aa9e8 - Use a loop to read consecutive bytes from the embedded controller to
handle read and write requests for widths of multiple bytes.  This
  can be used to read 16-bit battery status registers for example.
- Remove some unused variables and #if 0'd debugging cruft.
- Don't complain about a GPE query that fails due to AE_NOT_FOUND if the
  query method was _Q00.
2001-02-26 20:36:56 +00:00
John Baldwin
e3225e78f7 When ensuring the destination buffer is truncated for a string obtained
from a BIF, use the size of the destinatino buffer, not the length of the
string to determine where to put the nul char.  As a side effect, the
old code would truncate the string by one character while it was possibly
overflowing the buffer.
2001-02-26 20:32:18 +00:00
Mike Smith
358cd20f3a Typo fix; use & to test for bits set in the status register.
Submitted by:	Joel Jacobson <jake@3ware.com>
2001-02-26 20:13:19 +00:00
John Hay
88fe45dd33 Fix clock selection for X.21 interfaces. 2001-02-26 16:30:02 +00:00
Noriaki Mitsunaga
205274e87d o Check the size of I/O window handed by parent bus.
o Allocate memory mapped by pcic even when not used for ncv.
  This is for PC-Cards which needs offset, because I/O space should not be
  used by other devices.

Pointed-out-by: YAMAMOTO Shigeru <shigeru@iij.ad.jp>
2001-02-26 12:26:29 +00:00
Seigo Tanimura
87a636ccb0 - Mutexify midi(4). The driver runs under the giant lock by default.
If you ever want to run midi(4) out of the giant lock, uncomment
MIDI_OUTOFGIANT in midi.h. Confirmed to work for csamidi with WITNESS
and INVARIANTS.

- midi_info, midi_open and seq_info are now tailqs, allowing arbitrary
numbers of devices to be configured.

- Do not send an active sensing message to reset midi modules.

- Clone /dev/sequencer*. /dev/sequencer0 and /dev/sequencer are generated
upon initialization.
2001-02-26 07:36:24 +00:00
Mike Smith
ac91d75193 Major update and bugfix for the 'mly' driver.
- Convert to a more efficient queueing implementation.
 - Don't allocate command buffers on the fly; simply work from a
   static pool.
 - Add a control device interface, for later use.
 - Handle controller overload better as a consequence of the
   improved queue implementation.
 - Add support for the XPT_GET_TRAN_SETTINGS ccb, and correctly
   set the virtual SCSI channels up for multiple outstanding I/Os.
 - Update copyrights for 2001.
 - Some whitespace fixes to improve readability.

Due to a misunderstanding on my part, previous versions of the
driver were limited to a single outstanding I/O per virtual drive.
Needless to say, this update improves performance substantially.
2001-02-25 22:48:34 +00:00
Noriaki Mitsunaga
b94193dfc1 o Check the size of I/O window handed by parent bus. 2001-02-25 14:01:46 +00:00
Noriaki Mitsunaga
fe80cc3e0d o Check the size of I/O window handed by parent bus.
o Check if it is in PIO_MODE when memory window is not handed.
2001-02-25 14:01:05 +00:00
Poul-Henning Kamp
174b5e9aec Make "md" and "mdctl" macroized parameters.
Implement "-l" option to mdconfig which can list one or all md devices.

Submitted by:   Dima Dorfman <dima@unixfreak.org>
2001-02-25 13:12:57 +00:00
Noriaki Mitsunaga
a4539b3e56 o Support AUTO SENSE correctly.
o Offset and period in synch messages and width negotiation should be
  done for per target not per lun. Move these from *lun_info to
  *targ_info.
o Change in handling XPT_RESET_DEV and XPT_GET_TRAN_SETTINGS .
o Change CAM_* xpt_done return values.
o Busy loop did not timeout. Change this to timeout as original NetBSD/pc98.

Reviewed by:	bsd-nomads ML
2001-02-25 12:40:30 +00:00
Poul-Henning Kamp
57e9624ec9 Make md/mdconfig do kld.
Submitted by:	dcs
2001-02-24 16:26:41 +00:00
Warner Losh
e1b10b380d Additional enhancments to allow IBM Etherjet cards to be probed,
attached and ifconfigable.  The card doesn't interrupt yet.

Also, move towards bus space by introducing new macros/inline
functions which make such a move much easier than before.

These inline functions are setup now to work around an IBM EtherJet
pccard cardbus bridge incompatibility.  The card works in 8 bit mode,
but not in 16-bit mode when it is connected to a cardbus bridge for
reasons unknown.  The Linux driver also has a similar workaround in
it.

Future work will include making the above workaround runtime
conditional rather than compile time conditional, as well as fixing
the interrupts in pccards and converting it to bus space.
2001-02-23 08:08:21 +00:00
Matt Jacob
4102f2f6ef Fix a longstanding bug- we had the sense of what bit 14
for the ICB firmware options meant- *I* had taken it to
mean that if you set it, Node Name would be ignored and
derived from Port Name. Actually, it meant the opposite.
As a consequence- change ICBOPT_USE_PORTNAME to the
define ICBOPT_BOTH_WWNS- makes more sense.

Fix wrong input bitmap for MBOX_DUMP_RAM command. Call
ISP_DUMPREGS if we get a f/w crash. Add ISPCTL_RUN_MBOXCMD
control command (so outer layers can run a mailbox command
directly) and add a ISPASYNC_UNHANDLED_RESPONSE hook so
outer layers can understand response queue entries we
might not know about.
2001-02-23 05:35:50 +00:00
Peter Wemm
c14e19116f Sigh, nobody ever got back to me about this. So, here it is..
Implement auto scsi scan at insert time for the aic driver.
2001-02-23 02:32:31 +00:00
Bill Paul
d467c136d0 Apply patch to allow TX underrun handling without issuing a complete
chip reset. Just temporarily turn off the transmitter instead.

Submitted by:	Stephen McKay <mckay@freebsd.org>
2001-02-22 19:26:55 +00:00
Bill Paul
07f65363cd Big round of minor updates:
- Use pci_get_powerstate()/pci_set_powerstate() in all the other drivers
  that need them so we don't have to fiddle with the PCI power management
  registers directly.
- Use pci_enable_busmaster()/pci_enable_io() to turn on busmastering and
  PIO/memory mapped accesses.
- Add support to the RealTek driver for the D-Link DFE-530TX+ which has
  a RealTek 8139 with its own PCI ID. (Submitted by Jason Wright)
- Have the SiS 900/National DP83815 driver be sure to disable PME
  mode in sis_reset(). This apparently fixes a problem on some
  motherboards where the DP83815 chip fails to receive packets.
  (Submitted by Chuck McCrobie <mccrobie@cablespeed.com>)
2001-02-21 20:54:22 +00:00
Justin T. Gibbs
1478c71123 aic7xxx.c:
Use the target offset rather than the target Id to reference
	the untagged SCB array.  The offset and id are identical save
	in the twin channel case.  This should correct several issues
	with the 2742T.

	Set the user and goal settings prior to setting the current
	settings.  This allows the async update routine to filter out
	intermediate transfer negotiation updates that may be less
	than interesting.  The Linux OSM uses this to reduce the amount
	of stuff printed to the console.

aic7xxx.seq:
	Correct an issue with the aic7770 in twin channel mode.
	We could continually attempt to start a selection even
	though a selection was already occurring on one channel.
	This might have the side effect of hanging our selection
	or causing us to select the wrong device.

	While here, create a separate polling loop for when we
	have already started a selection.  This should reduce
	the latency of our response to a (re)selection.  The diffs
	look larger than they really are due to some code rearrangement
	to optimize out a jmp.

aic7xxx_freebsd.c:
	Use the target offset rather than the target Id to reference
	the untagged SCB array.  The offset and id are identical save
	in the twin channel case.  This should correct several issues
	with the 2742T.

aic7xxx_inline.h:
	Get back in sync with perforce revision ID.

aic7xxx_pci.c:
	Identify adapters in ARO mode as such.

	Ensure that not only the subvendor ID is correct (9005)
	but also that the controller type field is valid before
	looking at other information in the subdevice id.  Intel
	seems to have decided that their subdevice id of 8086
	is more appropriate for some of their MBs with aic7xxx
	parts than Adaptec's sanctioned scheme.

	Add an exclusion entry for SISL (AAC on MB based adapters).
	Adapters in SISL mode are owned by the RAID controller, so
	even if a driver for the RAID controller is not present,
	it isn't safe for us to touch them.
2001-02-21 20:50:36 +00:00
Yoshihiro Takahashi
2eb8169a1a Fixed warnings. 2001-02-21 11:28:02 +00:00
Alfred Perlstein
729d4f1db0 Fix vinum for both devfs and non-devfs systems.
userland tool:

  Use the vfs.devfs.generation sysctl to test for devfs presense
  (thanks phk!) when devfs is active it will not try to create the
  device nodes in /dev and therefore will not complain about the
  failure to do so.

  Revert the change in the #define for VINUM_DIR in the kernel
  header so that vinum can find its device nodes.

  Replace perror() with vinum_perror() to print file/line when
  DEVBUG is defined (not defined by default).

kernel:

  Don't use the #define names for the "superdev" creation since
  they will be prepended by "/dev/" (based on VINUM_DIR), instead
  use string constants.

  Create both debug and non-debug "superdev" nodes in the devfs.

Problem noticed and fix tested by: Martin Blapp <mblapp@fuchur.lan.attic.ch>
2001-02-20 22:07:36 +00:00
Alfred Perlstein
1a1f84bdd7 forced commit to note that the last delta also reordered some code in
remove_sd_entry() to:

  Simplify (hopefully) it by moving all error returns closer to
  the beginning of the function.

  Return an error when "Error removing subdisk %s: not found in
  plex %s\n" would have been reported, as I doubt that we are "OK"
  after printing that error message.
2001-02-20 12:14:01 +00:00
Alfred Perlstein
d9ca06d2a3 Take a shot at making vinum devfs aware.
Adding make_dev() and destroy_dev() calls in (hopefully) the right
places.

This is done by calling make_dev() in each object constructor and
caching the dev_t's returned from make_dev() in each struct
'subdisk'(sd), 'plex' and 'volume' such that the 'object'_free()
functioncs can call destroy dev.

This change makes a subset of the old /dev/vinum appear under devfs.

Enough nodes appear such that I'm able to mount my striped volume.

There may be more work needed to get vinum configuration working
properly.
2001-02-20 11:37:04 +00:00
Kris Kennaway
dd76c70387 Typo fixes: prefered -> preferred
There are some others in contributed/external code I haven't touched.
2001-02-20 10:30:22 +00:00
Warner Losh
d2a1864b0a Take luigi's suggestion and move the check for nothing to do to before the
lock so we don't have lots of null lock/release pairs.
2001-02-20 04:43:59 +00:00
Warner Losh
0aa477423a Add DC_UNLOCK before first return. This caused returns when dc was on
a shared interrupt.

Pointed out by tegge.
2001-02-20 04:21:27 +00:00