Commit Graph

6258 Commits

Author SHA1 Message Date
Mike Smith
feade91944 Reverse the logic here again with regards to "trusted" ACPI timer
implementations.  More of them seem to be broken, so only "trust"
timers we know work.
2001-08-03 09:52:53 +00:00
Mike Smith
d93b034fe9 Shoud build resources in the _CRS buffer. Oops.
Submitted by:	"neckpain@nettaxi.com" <neckpain@nettaxi.com>
2001-08-03 08:38:49 +00:00
Mike Smith
a692219d8a Move the resource pointer when we reallocate the buffer.
Submitted by:	"neckpain@nettaxi.com" <neckpain@nettaxi.com>
2001-08-03 08:38:11 +00:00
Scott Long
c6eafcf2c5 Reformat for 80 columns. Sorry, but I had to do it. 2001-08-03 00:50:30 +00:00
George C A Reid
1ad86e6dd7 Set up the via_chinfo structures properly so we write to the correct
registers later on; this fixes the VIA82C686 sound problems recently
reported by a number of people.
2001-08-02 22:13:10 +00:00
Kazutaka YOKOTA
0426db70c6 Include opt_splash.h. 2001-08-02 13:23:17 +00:00
Kazutaka YOKOTA
2fe5e0b184 Use #ifdef DEV_SPLASH (from opt_splash.h) rather than
#if NSPLASH > 0 (from splash.h) to test the presence
of the splash driver.
2001-08-02 13:22:33 +00:00
Kazutaka YOKOTA
eac47d67be Add FBIO_BLANK ioctl support. Return ENODEV for yet-to-be-
supported ioctls for now.
2001-08-02 11:26:30 +00:00
Kazutaka YOKOTA
6d1699583d Add some definitions. Their actual support will be added
to video drivers later.
2001-08-02 11:17:38 +00:00
Maxim Sobolev
fe603109d1 - Deny detaching requests until device is still open, otherwise it is possible
to hang or panic kernel by detaching disk from which fs is mounted;
- replace "md" with MD_NAME in yet another place.

Reviewed by:	phk
Approved by:	phk
2001-08-02 10:19:13 +00:00
Kazutaka YOKOTA
4866e2769a Refine cursor type/shape control escape sequences and
ioctls. We can now add ve, vi and vs capabilities to
cons25 in termcap.

Discussed with and tested by: ache
2001-08-02 08:30:40 +00:00
Matt Jacob
d51456f800 Oops- don't set 'goal' twice when you mean to set 'nvrm' as well.
This breaks bogus NVRAM boards.

MFC after:	1 day
2001-08-02 00:34:56 +00:00
Dima Dorfman
635751fa8c Fix grammar nit. 2001-08-01 20:16:12 +00:00
Greg Lehey
d505403792 open_device: Recognize ar device.
Submitted by:  Valery Kotchiev <valery@rudiment.dk>
2001-08-01 04:35:28 +00:00
Bill Paul
89b1abc0bf Re-order things slightly in the RX handler for VLAN support: we need
call vlan_input_tag() after stripping the ether header from the frame
with m_adj(), not before.

Noticed by: Brooks Davis <brooks@one-eyed-alien.net>
2001-07-31 16:38:58 +00:00
Jake Burkholder
8aa920fd1d Make the openfirmware functions work on 64 bit architectures by using
a standard cell_t type for the fields of all argument structs.  Also
make ihandle_t and phandle_t unsigned to avoid sign extension problems.

Approved by:	benno
2001-07-31 03:36:26 +00:00
Jake Burkholder
c22c65b1d4 Quiet uninitialized variable warning (also a bug). 2001-07-31 03:32:24 +00:00
Mike Smith
f16527bb44 The current resource buffer returned from an interrupt link device
in the case where there are no interrupts routed for it does not
contain enough space to use it to route an interrupt.  In the case
where we need to route an interrupt, throw away the returned buffer
and create a new one containing the interrupt we want.
2001-07-30 09:01:18 +00:00
Mike Smith
6d63101a75 - Prevent the ACPI code from being loaded as a module other than at
boot time.  Loading as a module once the system is up and running
   doesn't make any sense.

 - Fix acpi_FindIndexedResource (it would only check the first resource),
   changes the calling interface.

 - Add a new helper function (acpi_AppendBufferResource) to help building
   buffers containing resources.
2001-07-30 08:59:43 +00:00
Mike Smith
d8a9fe36a1 Minor updates (no functional changes)
- Remove the beer-ware license (reqested by phk)
 - Reorganise so that the PIIX4 workaround code is kept together, and
   switch the workaround function via the timecounter struct, saving
   a compare in the read-timecounter codepath.  Also indicate that
   the workaround is active by changing the timecounter hardware string.
2001-07-30 08:57:55 +00:00
Matt Jacob
9ce9bdaf8a Redo how we manage SCSI device settings- have a 3rd flags (nvram) that records
either what's in NVRAM or what the safe defaults would be if we lack NVRAM.
Then we rename cur_XXXX to actv_XXXX (these are the currently active settings)
and the dev_XXX settings to goal_XXXX (these are the settings which we want
cur_XXXX to converge to).

This probably isn't entirely final as yet- but it's a lot closer to now
being what it should be, including allowing camcontrol to actually set
specific settings.
2001-07-30 01:00:21 +00:00
Matt Jacob
d9c272f3ea Redo how we manage SCSI device settings- have a 3rd flags (nvram) that records
either what's in NVRAM or what the safe defaults would be if we lack NVRAM.
Then we rename cur_XXXX to actv_XXXX (these are the currently active settings)
and the dev_XXX settings to goal_XXXX (these are the settings which we want
cur_XXXX to converge to).

Roll core minor.
2001-07-30 00:59:32 +00:00
Matt Jacob
df225582bf Redo how we manage SCSI device settings- have a 3rd flags (nvram) that records
either what's in NVRAM or what the safe defaults would be if we lack NVRAM.
Then we rename cur_XXXX to actv_XXXX (these are the currently active settings)
and the dev_XXX settings to goal_XXXX (these are the settings which we want
cur_XXXX to converge to).
2001-07-30 00:59:06 +00:00
Thomas Moestl
9c4968d152 Disallow ATAPI CD transfers that are not a multiple of the device block
size (previously, the transfer size would be rounded up to a multiple of
the block size, which would overflow the buffer).
This fixes panics when doing things like trying to mount audio CD's.

PR:		kern/21946
Review Timeout:	sos
2001-07-29 21:01:13 +00:00
Justin T. Gibbs
00efe71bc7 Remove a bootverbose diagnostic that makes bootverbose just too verbose. 2001-07-28 18:45:52 +00:00
Bill Paul
2be840b347 Remember to zero out certain things that we malloc() and/or contigmalloc(). 2001-07-27 19:38:56 +00:00
Bill Paul
386a59d734 Uncomment a return(ENXIO) that I commented out for debugging purposes. 2001-07-27 18:28:37 +00:00
Brooks Davis
a4806cd1df Cleanup duplication in Aironet headers
PR:		kern/29210
Submitted by:	Doug Ambrisko <ambrisko@ambrisko.com>
MFC after:	3 days
2001-07-27 16:05:21 +00:00
Mike Smith
7b60d04d2c The ACPI timer register corruption problem is resolved in the PIIX4
starting with the PIIX4M.  Restrict enabling the workaround to those
chips known to be buggy.
2001-07-27 09:01:13 +00:00
Peter Wemm
e664fdb13c The kernel *does* now define setjmp/longjmp. Dont duplicate it here.
In file included from ../../../dev/vinum/vinumhdr.h:77,
                 from ../../../dev/vinum/vinum.c:44:
../../../dev/vinum/vinumext.h:165: warning: redundant redeclaration of `setjmp' in same scope
../../../sys/systm.h:96: warning: previous declaration of `setjmp'
../../../dev/vinum/vinummemory.c:44: warning: redundant redeclaration of `longjmp' in same scope
../../../sys/systm.h:97: warning: previous declaration of `longjmp'
2001-07-27 00:44:36 +00:00
Thomas Moestl
3d3c27fedf Make sure the total number of sectors is not 0 for a vnode-type md to
avoid a division by zero which would occur on open() in this case.

Reviewed by:	phk
2001-07-26 20:05:20 +00:00
Mike Smith
b964f385bb Fix typo (* -> &)
Submitted by:	Andrew Doran <ad@netbsd.org>
2001-07-26 02:20:47 +00:00
Scott Long
4aa620cdc6 Add /dev/hpn? as an alias to /dev/aac? so that the HP version of the CLI
utility will work, and document it in the manpage.

MFC after:	3 days
2001-07-25 22:36:17 +00:00
Jonathan Lemon
48e417eb5a Reset the device's powerstate to d0 when resuming from a suspend
operation, not just when we initally attach to the device.

Submitted by: warner
2001-07-25 18:00:17 +00:00
Mitsuru IWASAKI
44df042b35 Better checking of duplicated interrupt handler installation.
Reviewed by:	msmith
2001-07-25 16:13:30 +00:00
Mitsuru IWASAKI
5394e6a026 Some minor fixes.
- Set system power profile only when AC-line status has canged.
 - Get initial AC-line status after whole system is up.

Reviewed by:	msmith
2001-07-25 16:08:58 +00:00
Dima Dorfman
101f105db2 Move the kernel stuff out of snoop.h. It was only there because some
of the snp* functions needed to be called from tty.c, which is no
longer the case.
2001-07-25 14:47:56 +00:00
Matt Jacob
f44257c29a Remove ISP_SMPLOCK stuff- we're just using locking now.
Correctly reintroduce loop_seen_once semantics- that is, if we've never
seen good link, start bouncing commands with CAM_SEL_TIMEOUT. But we
have to be careful to have let ourselves try (in isp_kthread) to check
for loop up at least once.

PR:		28992
MFC after:	1 week
2001-07-25 04:23:52 +00:00
Matt Jacob
3910362ab8 Roll minor version. Remove ISP_SMPLOCK nonsense. We're using full locking,
and that's final.

MFC after:	1 week
2001-07-25 04:21:53 +00:00
Brooks Davis
bbce7eba7f IFT_8021_VLAN -> IFT_L2VLAN per if_vlan_var.h rev 1.9. With this change
LINT compiles, but doesn't link.
2001-07-25 00:19:59 +00:00
Bill Paul
2a5772457d Turn on __STRICT_ALIGNMENT. We need this to fix up alignment so the alpha
won't trap.
2001-07-23 22:27:17 +00:00
Bill Paul
6b8fa04225 AIEEE! Commit the firmware image too. *blush* 2001-07-23 21:01:36 +00:00
Bill Paul
de8e167ce6 Grrr. Module depends on vlan.h, and I committed the wrong version
of if_txpreg.h, which didn't have sc_rxbufprod defined in the softc
struct.
2001-07-23 20:54:31 +00:00
Bill Paul
362c5c1e02 You were knocked senseless by the Boomerang, spun around by the Cyclone,
blown over by the Hurricane and had a house dropped on you by the Tornado.
Now it's time to have your parade rained on by... the Typhoon!

This commit adds driver support for 3Com 3cR990 10/100 ethernet
adapters based on the Typhoon I and Typhoon II chipsets. This is actually
a port of the OpenBSD driver with many hacks by me.

No Virginia, there isn't any support for the hardware crypto yet. However
there is support for TCP/IP checksum offload and VLANs.

Special thanks go to Jason Wright, Aaron Campbell and Theo de Raadt for
squeezing enough info out of 3Com to get this written, and for doing
most of the hard work.

Manual page is included. Compiled as a module and included in GENERIC.
2001-07-23 20:44:54 +00:00
Kris Kennaway
56bded8a29 s/adress/address/
Inspired by:    OpenBSD
MFC After:      1 week
2001-07-23 12:05:27 +00:00
Kris Kennaway
b0b32f29dc Typo fix: fasion -> fashion
Inspired by:	OpenBSD
MFC After:	1 week
2001-07-23 11:03:48 +00:00
Assar Westerlund
8f8cd845fa add %option nounput 2001-07-22 23:15:14 +00:00
Ian Dowse
071dbcd2cc Add a few missing spl calls in preparation for an MFC of the miibus
support.
2001-07-22 21:39:54 +00:00
Ian Dowse
2cc42e154e Remove an old hack that remembered if the card type was Linksys by
storing a flag in the global variable 'linksys' during the probe
routine and reading it during the attach routine. We now have the
ED_VENDOR_LINKSYS vendor code stored in sc->vendor, so check that
instead.
2001-07-22 21:31:44 +00:00
Mitsuru IWASAKI
56d8cb57b9 Don't do sleep state transition if specified sleep state is not
supported by the system.
2001-07-22 19:13:54 +00:00
Ian Dowse
dc53090488 Attach the miibus for Linksys/Dlink cards from the attach routine,
not from the probe routine. This was an oversight when I originally
ported the miibus support to -current, though it was mostly harmless.

We now set the vendor code to the new value ED_VENDOR_LINKSYS in
ed_pccard_Linksys() at probe time. Then ed_pccard_attach() checks
the vendor code, and sets up the miibus if appropriate.

Reviewed by:	imp
2001-07-22 18:58:44 +00:00
Kazutaka YOKOTA
a4fc697e58 - Fix "off by one" error in VT_WAITACTIVATE. Correctly accept
0 as meaning the requesting vty.
- Accept 0 as the requesting vty in VT_ACTIVATE as in VT_WAITACTIVE.

PR: 24423
MFC after: 10 days
2001-07-22 13:58:23 +00:00
Mike Smith
0bc88fe1eb Add another Dell 3/Di PCI ID. You'd think they had enough of these
already...
2001-07-22 04:06:36 +00:00
Assar Westerlund
20de0f980e null_do_probe: mark as unused 2001-07-21 17:10:30 +00:00
Mike Smith
bfae45aa43 Convert from acpi_strerror() to AcpiFormatException()
Fix dangling include of the dear departed acpi_ecreg.h
2001-07-21 10:24:37 +00:00
Mike Smith
9d839ea8e4 Update the OSD module to match the ACPI CA 20010717 import.
Submitted by:	"Grover, Andrew" <andrew.grover@intel.com> (OsdHardware.c)
2001-07-21 04:10:01 +00:00
Mike Smith
787fa5b805 Implement a "proper" timecounter hung off the ACPI timer device.
This code is based on the mp_clock code by phk.  It attempts to
detect the PIIX4 (see comments for details) and use a workaround
for its problems.

This code is experimental, and could use some testing and review by a
timekeeping enthusiast.
2001-07-21 04:08:42 +00:00
Mike Smith
da3b867e37 Merge the EC register definitions into the EC module proper, they're not
used anywhere else.

AcpiOsSleepUsec() -> AcpiOsStall()
2001-07-21 04:06:44 +00:00
Mike Smith
ad5dc75bb4 Use our saved copy of the FADT rather than fetching it again. 2001-07-21 04:05:32 +00:00
Mike Smith
67ce16735b Don't call ourselves a "control method" anything, that's not useful.
Move the "button pressed" diagnostics to the point where we can print
out which button was actually pressed.
2001-07-21 04:05:08 +00:00
Mike Smith
acf72ef4f1 The API for loading tables changed (we no longer explicitly search for the
RSDP, it's now found via a callback).

AcpiOsSleepUsec() went away, use AcpiOsSleep() instead (we could use
AcpiOsStall() too)

AcpiFormatException() was changed to make more sense (it behaves like
our old acpi_strerror() did), so throw acpi_strerror() away (still
#defined in acpivar.h though, we need to sweep these seperately).
2001-07-21 04:04:03 +00:00
Kazutaka YOKOTA
9a1d7da7c1 Fix typo; the meaning of the 3rd parameter to genkbd_keyaction() is
'up' rather than 'down'.

PR: 22466
MFC after: 10 days
2001-07-20 14:49:54 +00:00
Kazutaka YOKOTA
34e45f9e71 Fix off by one error for ESC[1J.
PR: kern/18381
MFC after: 10 days
2001-07-20 14:08:12 +00:00
Kazutaka YOKOTA
4dbf3ccb9b Define a couple of subroutines to replace duplicated common code. You
shoulnd't see any functional difference.
2001-07-20 13:10:59 +00:00
Kazutaka YOKOTA
764952572b Return consistent key action codes at key press and release
events. Otherwise you would see unexpected results if shift or
locking keys are defined to give different actions depending
on other shift/locking keys' state.

Please keep the ukbd module and the kernel in sync, otherwise
the USB keyboard won't work after this change.
MFC after:	10 days
2001-07-20 13:05:57 +00:00
Mike Smith
f7ae7f1d00 We haven't used this for ages, and we're not going to either. 2001-07-20 09:44:55 +00:00
Mark Murray
87242f3724 Fix type warnings.
PR: 29101
2001-07-20 08:58:04 +00:00
Takanori Watanabe
6161544ca7 Add ACPI S2-S4BIOS Suspend/Resume code.
Some problems may remain.

Reviewed by:iwasaki
2001-07-20 06:07:34 +00:00
Scott Long
19f2be11b0 Limit the device to only one playback channel until I can figure out why
a) newpcm insists on using only the highest number channel available, and
b) the maestro3 driver no longer likes anything above channel 0.
2001-07-19 20:53:52 +00:00
Scott Long
e93d24c2f0 Fix an off-by-one error in the dma tag. This was causing the VM system to
freak out occasionally.

MFC after:	1 week
2001-07-19 20:51:29 +00:00
Jonathan Lemon
74396a0a26 Only turn on MWI if the PCI configuration word indicates that it
is supported, in addition to checking for a valid cacheline size.
Add a missing splx() in fxp_tick that got dropped.

Found by: peter
MFC in: 3 days
2001-07-19 15:48:00 +00:00
Kris Kennaway
a081aa7d72 Quiet a variable format-string warning.
MFC after:    1 week
2001-07-19 02:16:24 +00:00
Justin T. Gibbs
cd036e891a ahc_pci.c:
If bus_dma will give us addresses > 32 bits, setup our dma tag
	to accept up to 39bit addresses.

aic7770.c:
	Update the softc directly rather than use an intermediate
	"probe_config" structure.

aic7xxx.c:
	Complete core work to support 39bit addresses for bulk data
	dma operations.  Controller data structures still must reside
	under the 4GB boundary to reduce code/data size in the sequencer
	and related data structures.  This has been tested under Linux
	IA64 and will be tested on IA64 for FreeBSD as soon as our port
	can run there.

	Add bus dmamap synchronization calls around manipulation of
	all controller/kernel shared host data structures.

	Implement data pointer reinitialation for a second data phase
	in a single connection in the kernel rather than bloat the
	sequencer.  This is an extremely rare operation (does it ever
	happen?) and the sequencer implementation was flawed for some
	of the newest chips.

	Don't ever allow our target role to initiate a PPR.  This
	is forbidden by the SCSI spec.

	Add a few missing endian conversions in the ignore wide pointers
	code.  The core has been tested on the PPC under Linux and should
	work for FreeBSD PPC.  As soon as I can test the OSM layer for
	FreeBSD PPC, I will.

	Move some of ahc_softc_init() into ahc_alloc() now that the
	probe_config structure is gone.

	Add a 4GB boundary condition on all of our dma tags.  32bit
	DAC under PCI only works on a single 4GB "page".  Although
	we can cross 4GB on a true 64bit bus, the card won't always
	be installed in one and we can save code space and cost in
	implementing high address support by assuming the high DWORD
	address will never change.

	Add diagnostics to ahc_search_qinfifo().

	Correct a target mode issue with bus resets.  To avoid an
	interrupt storm from a malicious third party holding the
	reset line, the sequencer would defer re-enabling the reset
	interrupt until either a select-out or select-in.  Unfortunately,
	the select-in enable bit is cleared by a bus reset, so a second
	reset will render the card deaf to an initiator's attempts to
	contact it.  We now re-enable bus reset interrupts immediately
	if the target role is enabled.

aic7xxx.h:
	Remove struct ahc_probe_config.

	SCB's now contain a pointer to the sg_map_node so we can perfrom
	bus dma sync operations on the SG list prior to queuing a command.

aic7xxx.reg:
	Register the Perforce ID for this file with the VERSION keyword
	so it is printed in generated files.

	Add the DSCOMMAND1 register which is used to access the high
	DWORD of address bits.

	Add the data pointer reinitialize sequencer interrupt code.

aic7xxx.seq:
	Register the Perforce ID for this file with the VERSION keyword
	so it is printed in generated files.

	Remove code to re-enable the bus reset interrupt after a select-in.
	In target mode we cannot defer this operation as ENSELI is cleared
	by a bus reset.

	Complete 39bit support.

	Generate a sequencer inteerrupt rather than handle the data
	pointers re-initialitation in the sequencer.

	Inline the "seen identify" assertion to save a few cycles.

	Short circuit the update of our residual data if we have
	fully completed a transfer.  The residual is correct from
	our last S/G load operation.

	Short circuit full SDPTR processing if the residual is 0.
	Just mark the transfer as complete.

aic7xxx_93cx6.c:
	Synchronize perforce IDs.

aic7xxx_freebsd.c:
	Complete untested 39bit support.

	Add missing endia conversions.

	Clear our residuals prior to starting a command.  The
	update residual code in the core only sets the residual
	if there is one.

aic7xxx_freebsd.h:
	Modeify ahc_dmamap_sync() macros to take an offset and a length.
	This is how sync operations are performed in NetBSD, and we should
	update our bus dma implementation to match.

aic7xxx_inline.h:
	Add data structure synchronization helper functions.

	Fix a bug in ahc_intr() where we would not clear our unsolicited
	interrupt counter after running our PCI interrupt handler.  This
	may have been the cause of the spurious PCI interrupt messages.

aic7xxx_pci.c:
	Adjust for loss of probe_config structure.

	Guard against bogus 9005 subdevice information as seen on some
	IBM MB configurations.

	Add 39bit address support.

MFC after: 10 days
2001-07-18 21:39:48 +00:00
Justin T. Gibbs
2d0fbde8e7 Add support for parsing version strings out of assembler source files
and outputing them in generated files.

Fixed a few other scanner bugs that for some reason didn't show up until
these modifications were made.

MFC after:	10 days
2001-07-18 21:03:32 +00:00
Dima Dorfman
ac60b28d35 Keep track of all "struct snoop"'s so that snp_modevent can fail with
EBUSY if there's a device still open.
2001-07-18 13:39:43 +00:00
Dima Dorfman
10b0e058bb Use MD_NAME and MDCTL_NAME constants where appropriate. 2001-07-18 13:32:38 +00:00
Bill Paul
248fa967ca Change the interrupt handler a bit so that we call the nge_rxeof() handler
when we get an RX_ERR interrupt rather than the nge_rxeoc() handler. The
rxeoc (end of channel) handler attempts to reinitialize the whole NIC,
which we don't want to do if we only received a bad packet.
2001-07-16 16:35:09 +00:00
Joerg Wunsch
3a5c2c86a8 Hrmpf. nyan's rev 1.25 commit to fdc.h crossed with my removal of it.
Back-integrate his (PC98) changes into fd.c.
2001-07-14 20:28:02 +00:00
Joerg Wunsch
246ed35d55 Yet another large non-function change.
. Integrate fdc.h into fd.c, with the removal of ft(4) there's no longer
  a reason to scatter things across two files.

. Sanitize comments.  Convert them into the style(9)-recommended
  multi-line form, make them sentences where apprpriate, etc.

. Declare all functions on top, and declare them in the order they
  appear in the file.  This order is totally chaotic, but Bruce
  convinced me that reordering the file wouldn't make it better either.

. Kill a `possibly uninitialized' warning (only seen with -O2) in
  fd_read_status().

. Make the comments at return (0|1) statements in fdstate() consistent.

. Nuke a ``keep the compiler happy'' dummy return at the end of fdstate(),
  gcc is smart enough to detect that it would never be reached anyway.
2001-07-14 20:25:01 +00:00
Noriaki Mitsunaga
b45f9c03c7 Catch up with NetBSD/pc98.
o Much cleanly separate NetBSD(XS) / FreeBSD(CAM) codes.
o Improve tagged queing support (full QTAG).
o Improve quirk support.
o Improve parity error retry.
o Impliment wide negotheation.
o Cmd link support.
o Add copyright of CAM part.
o Change for CAM_NEW_TRAN_CODE.
o Work around for buggy KME UJDCD450.

o stg: add disconnet condition.
o nsp: use suspend I/O.
and more. I thank Honda-san.

conf/options.pc98: add CT_USE_RELOCATE_OFFSET and CT_BUS_WEIGHT
dev/{ct,ncv,nsp,stg}/*_{pccard,isa}.c: add splcam() before calling
        attach/detach functions.

Tested by: bsd-nomads
Obtained from:  NetBSD/pc98
2001-07-14 00:38:51 +00:00
Mike Smith
822c2e6a94 Merge with latest version of the Mylex 6+ driver.
- All sources are built in a single object, reducing namespace pollution.
 - Kill the ready queue, and handle a busy response to mly_start in callers
   rather than deferring the command.
 - Improve our interaction with CAM:
   - Don't advertise physical channels as SCSI busses by default.
   - use the SIM queue freeze capability rather than queueing CDBs internally.
   - force bus reprobe at module load time.
 - Clean up more resources in mly_free.
 - Tidy up debugging levels.
 - Tidy up handling of events (mostly just code cleanliness).
 - Use explanatory macros for operations on bus/target/channel numbers.
2001-07-14 00:12:23 +00:00
Bill Paul
e7be9f9a1a Deal with the condition where we lose link in the middle of transmitting
a bunch of frames. In this case, the dc_link flag is cleared, and dc_start()
stops draining the if_snd send queue, which results in lots of 'no buffers
available' errors being reported to applications. The whole idea behind
not draining the send queue until the link comes up was to avoid having
the gratuitous ARP being lost while we're waiting for autoneg to complete
after the interface is first brought up. As an optimization, change the
test in dc_start() so that we only bail if dc_link is not set _and_ there
are less than 10 packets in the send queue. If the queue has many frames
in it, we need to drain them. If the queue has a small number of frames
in it, we can hold off on sending them until the link comes up.

MFC after: 1 week
2001-07-12 22:51:59 +00:00
Kazutaka YOKOTA
9a3a173bd3 - Define a convenience macro ISTTYOPEN().
- Slightly refine screen saver logic.

No functional change.
MFC after:	2 weeks
2001-07-12 11:43:29 +00:00
Matt Jacob
761d6b7150 Hmm. Let's try this on for size...
We originally had it such that if the connection topology was FL-loop
(public loop), we never looked at any local loop addresses. The reason
for not doing that was fear or concern that we'd see the same local
loop disks reflected from the name server and we'd attach them twice.

However, when I recently hooked up a JBOD and a system to an ANCOR SA-8
switch, the disks did *not* show up on the fabric. So at least the
ANCOR is screening those disks from appearing on the fabric. Now, it's
possible this is a 'feature' of the ANCOR. When I get a chance, I'll
check the Brocade (it's hard to do this on a low budget).

In any case, if they *do* also show up on the fabric, we should
simply elect to not log into them because we already have an
entry for the local loop. There is relatively unexercised code
just for this case.

MFC after:	2 weeks
2001-07-11 02:34:21 +00:00
Bill Paul
962315f66f Two optimizations:
1) Bite the bullet, and allow unaligned accesses without buffer copies
   on the i386 platform. According to some tests run by Andrew Gallatin,
   the buffer copy performance hit is greater than the unaligned access
   performance hit (especially with jumbo frames). We still need to copy
   everywhere else.

2) Enable interrupt moderation with a 100us timeout.

Submitted by: Andrew Gallatin <no longer at duke.edu>
MFC after: 1 week
2001-07-10 23:07:15 +00:00
Kazutaka YOKOTA
44b37d9627 Fix dependencies between kernel options:
- When both SC_PIXEL_MODE and SC_NO_FONT_LOADING are defined,
  quietly drop SC_NO_FONT_LOADING, because the pixel(raster)
  console requires font.
- When SC_NO_FONT_LOADING is defined, force SC_ALT_MOUSE_IMAGE.
  Without font, the arrow-shaped mouse cursor cannot be drawn.
- Fiddle and simplify some internal macros.
MFC after:	2 weeks
2001-07-10 14:13:34 +00:00
Peter Wemm
57385865a9 Somehow I missed this. Use INTR_TYPE_AV (high priority) instead of
INTR_TYPE_TTY (lowest priority).
2001-07-09 23:44:54 +00:00
Mike Smith
dfcd35dd08 Whoops; we get an ACPI_OBJECT back from evaluating a method, not
an ACPI_OPERAND_OBJECT.  Fix this so that the power resource type
can be properly checked, and we can get the system level and
resource order.
2001-07-09 21:24:59 +00:00
Joerg Wunsch
0e17a5bcdb Log when the user is turning debugging on/off.
Also sanitize the TRACE* macros a bit so they syntactically behave like
single C statements (even inside in `if' statement).

Submitted by:	des
2001-07-09 21:11:10 +00:00
Joerg Wunsch
5d54fe9172 Hmpf, remove two variables that got unused by rev 1.214. 2001-07-09 21:00:02 +00:00
Joerg Wunsch
83edbfa5ff Ouch, calculate correctly. With 300 rpm and 25 retries, it's 5 seconds
till timeout.
2001-07-09 20:53:19 +00:00
Joerg Wunsch
e3b525a006 Remove parts of rev 1.211 again: do not delete our children iff they
haven't been probed successfully.  It's a known bug that ISA hints
processing instantiates those devices, and prematurely killing them
has other unwanted side-effects.
2001-07-09 20:50:41 +00:00
Joerg Wunsch
3fef646ef0 As des' example shows us, DMA overruns could happen in a situation
where they will never succeed.  Add a stop-gap measure that will at
least eventually timeout the operation instead of retrying it
indefinately.

MFC after:	1 month
2001-07-09 20:46:45 +00:00
Bill Paul
75ff968cd5 Apply patch supplied by Jonathan Chen: use the correct arguments to
pci_enable_io(). We need to use SYS_RES_IOPORT/SYS_RES_MEMORY instead
of PCIM_CMD_PORTEN/PCIM_CMD_MEMEN.
2001-07-09 17:58:42 +00:00
Joerg Wunsch
fb35bd37f2 Another large patchset from Bruce.
Despite of a few cosmetic things like adding ``irritating silly
parentheses'' around all return values, this mainly improves FDC reset
handling by no longer gratuitously resetting the FDC all the time
(which causes it to lose the notion of the current track) but only in
case of errors, and it sanitizes the block and offset calculations in
fdstrategy() and fdstate().  Some additional cleanup added by me, in
particular the large switch in fdstate() now always uses return to
break out, and no branch falls off the end of the switch statement
anymore.  Per Bruce's suggestion, removed M_NOWAIT from the malloc()s
to simplify things.

Submitted by:	bde (mostly)
2001-07-08 20:50:20 +00:00
Bill Paul
2ce0498bd7 Do not set the MODE_1000 bit unless we actually have a gigabit link.
Previously, I had the MODE_1000 bit in the global config register set
unconditionally, which was wrong: we have to turn it off if we have
a 10/100 link. This is now handled in the nge_miibus_statchg() routine.

Discovered by: Nathan Binkert <binkertn@eecs.umich.edu>

(Note: this commit is being done from JFK airport. :P )
2001-07-08 16:24:01 +00:00
Mike Smith
83ac9b3bab Nuke the ACPI APIC driver. The ACPI CA infrastructure it depended on
is gone, and it's not coming back, and the whole driver needed to be
rethrought to deal with a major chicken-and-egg consideration.
2001-07-07 22:23:56 +00:00
Mitsuru IWASAKI
f0987736ef Fix typo in acpi_cpu_attach() and correct range checking in
acpi_cpu_speed_sysctl().
2001-07-07 18:39:13 +00:00
Mike Smith
fec754d4b4 Kill the old processor driver; the ACPI CA functions it depended on
are not coming back any time soon.  Implement a new 'acpi_cpu' driver
with support for CPU throttling and power policies.
2001-07-07 10:27:17 +00:00
Mike Smith
7d3bcec9fb Add acpi_GetTableIntoBuffer, to aid in fetching tables. 2001-07-07 10:20:17 +00:00
Mike Smith
db302f9945 Get the ACPI softc before we potentially dereference it. 2001-07-07 10:18:10 +00:00
Mike Smith
30185bcabe Quiet the complaint about the _SCP method if it doesn't exist; it's
not mandatory.
2001-07-07 10:17:22 +00:00
Mike Smith
8077a62b9c Oops, have to use AcpiSetCurrentResources, not invoke the _SRS method
directly.
2001-07-07 10:12:06 +00:00
Mike Smith
4a54f77582 Add support for user-requested override of cooling levels.
Monitor the system power profile, and use _SCP to adjust thermal zones
accordingly.

Simplify the behaviour of the timeout routine, and add some temporary
debugging.
2001-07-07 01:49:15 +00:00
Mike Smith
59c82e8fd0 Add support for system power profiles; select "performance" when AC power
is available and "economy" when it is not.
2001-07-07 01:46:40 +00:00
Mike Smith
02dabf5bf0 Support for system "power profiles". Currently we support two profiles;
"economy" and "performance".
2001-07-07 01:45:37 +00:00
Mike Smith
2b80a316c3 This was only half-implemented when I committed it, and certainly didn't
work.  Now it's implemented and seems to work.
2001-07-06 09:00:07 +00:00
Kazutaka YOKOTA
e67e345124 Call ttymalloc() when sysmouse is opened, rather than
when the driver is attached.
MFC after:	2 weeks
2001-07-06 03:24:40 +00:00
John Baldwin
52b3919d31 Make these compile again by adding proc.h include for GIANT_REQUIRED
that is in included vm headers.
2001-07-05 21:28:47 +00:00
Matt Jacob
8e6a12fcad Oops- missed a CAMLOCK_2_ISP case. 2001-07-05 19:34:06 +00:00
Matt Jacob
45c9a36af5 Things have become cinched down more tightly about assertions for Giant.
This uncovered some missing spots where I trade off between isp's lock
and Giant as I enter CAM.
2001-07-05 17:14:57 +00:00
Benno Rice
beefc79739 Set vendor string correctly for the Apple KeyLargo.
Forgotten by:	benno
Spotted by:	n_hibma
2001-07-05 12:04:19 +00:00
Nick Hibma
55e6acd71b Pull in the current version of NetBSD's ulpt.c, supporting bidirectional
communication with printers.
2001-07-05 10:15:37 +00:00
Nick Hibma
48405163d9 Regen. 2001-07-05 10:14:40 +00:00
Nick Hibma
e1f5734cbe Pull in the most recent version of usb_quirks.h and propagate the necessary
changes to the various files.

Also, pull in most of the current usb_subr.c file.
2001-07-05 10:12:59 +00:00
Nick Hibma
b74562cf03 Make the string argument a const. 2001-07-05 10:09:22 +00:00
Nick Hibma
c077cffc2e Update with NetBSD version
Remove duplicates

NOTE: USB_PRODUCT_SANDISK_IMAGEMATE has changed to
USB_PRODUCT_SANDISK_SDDR05A
2001-07-05 09:35:46 +00:00
Mike Smith
76d1dff4b4 Improve some error messages slightly. 2001-07-05 07:21:12 +00:00
Mike Smith
4fa387b692 Implement PCI interrupt routing using the ACPI data attached to the
PCI bus object.  This should deal both with already-routed interrupts
as well as devices that need an interrupt routed.

Note that it *doesn't* deal with interlocked interrupt dependancies, nor
does it select between interrupt options in a smart way.  These are
optimisations that need further work.
2001-07-05 07:20:51 +00:00
Mike Smith
93962773c5 Fix a couple of misunderstandings in the monitor code. Passive cooling
is a parallel adjunct to active cooling, not a lesser evil.  The _ACx
levels sort from 0 being hottest, not coolest.

Sanity check the returned temperature values, since we are having
trouble reading them on some systems.

Rearrange sysctl nodes a bit; this is probably close to the final layout.
2001-07-05 07:19:17 +00:00
Mike Smith
6f69255b9f Add a new helper function for finding resources in resource buffers.
Move the ACPI generic battery code into a new file.
2001-07-05 07:14:30 +00:00
Warner Losh
e3b32280d9 Sync to pccarddevs 1.12 2001-07-05 03:20:48 +00:00
Warner Losh
6b3224653a Merge from NetBSD:
1.131: crhistos; cn40bc ne clone
	1.130: ichiro; COREGA FEther PCC-TXF
	1.129: ichiro; nits
	1.128: ichiro; National Instruments pcmcia GPIB
	1.127: jhawk; Socket EA ethernet
	1.126: ichiro; Intel PRO/Wireless 2001 LAN PC Card
	1.125: ichiro; BUFFALO AirStation 11Mbps WLAN Card
	1.124: ichiro; Corega FEther PCC-TXD
	1.123: onoe; Cisco Aironet 350 Series
	1.122: ichiro; I-O DATA WN-B11/PCM wlan
	1.121: aymeric; Synergy 21 S21810+
	1.120: thorpej; D-LINK DMF-560TX
	1.119: ichiro; typo
	1.118: ichiro; some wavelan card
	1.117: ichiro; Contec FLEXLAN/FX-DS100-PCC wavelan
	1.116: ichiro; COMPAQ Wireless CARD NC5004(Prism2)
	1.114: thorpej; Xircom CreditCard Token Ring II
2001-07-05 03:19:43 +00:00
Joerg Wunsch
6044485346 More cleanup when detaching. Clone device entries will now be
destroyed properly (otherwise bad things would happen after a clone
dev had been created, and the module was kldunloaded).  Allocated
children that have not successfully probed are being deleted again
(otherwise fd0 and fd1 have always been allocated, even if only
fd0 was acutally present, and fd1 even survived kldunloading the
module).

Still, kldunloading leaves remnants of the previously existing devices
intact.  Why doesn't it destroy all the devices?  As a consequence,
since dev->descr now points into no longer allocated memory, the
system panics deep inside printf(9) when running devinfo(1) after
kldunloading the module.  Ideas sought...

Also, when kldloading the module on a hints-populated isab0, this bus
somehow has already created an fdc0 entry (a dummy) so the load
attempt fails and will register fdc1 instead.  What are those dummy
entries for?  Loading the module from the bootloader works, and it
can be unloaded an re-loaded then later.
2001-07-04 22:10:33 +00:00
Matt Jacob
ab163f5fee Add CAM_NEW_TRAN_CODE support. Use correct CAMLOCK_2_ISPLOCK macros.
For fibre channel, start going for the gusto and using AC_FOUND_DEVICE
and AC_LOST_DEVICE calls to xpt_async when devices appear and disappear
as the loop or fabric changes.

ISPASYNC_FW_CRASH is the async event code where the platform layer
deals with a firmware crash.
2001-07-04 18:54:29 +00:00
Matt Jacob
9927912756 Macroize request/response in/out queue pointer access. 2001-07-04 18:52:23 +00:00
Matt Jacob
559a1ad2c1 Some possibly helpful casts. 2001-07-04 18:51:58 +00:00
Matt Jacob
f0f4c8ae4b Add a microcomment about how you'd use ispds64_t or ispdlist_t
for CTIO3/CTIO4 entries.
2001-07-04 18:51:06 +00:00
Matt Jacob
1ee34f05dd Add a bunch of additional defines for completion codes. Define
some of the RIO (reduced interrupt operation) stuff. Add 64 bit
data list (DSD type 1) and arbitrary data list (DSD type 2)
data structure defines.

Add macros that parameterize usage of the Request/Response in/out
queue pointers. When we finish 2300 support, different registers
will be accessed for the 2300.
2001-07-04 18:49:00 +00:00
Matt Jacob
b91862efef Firmware crashes handled in platform specific code (isp_async call).
Fix longstanding silly buglet that left a hole in the debug log defines.
2001-07-04 18:46:50 +00:00
Matt Jacob
9b9288ec4a More 2300 support prep- the Request/Response in/out pointers are
part of the PCI block for the 2300- not software convention usage
of the mailbox registers- so we macrosize in/out pointer usage.

Only report that a LIP destroyed commands if it actually destroyed
commands. Get the chan/tgt/lun order correct.  Fix a longstanding
stupid bug that caused us to try and issue a command with a tag on
Channel B because we were checking the tagged capability for the
target against Channel A.

A firmware crash is now vectored out to platform specific code
as an async event.

Some minor formatting tweaks.
2001-07-04 18:42:41 +00:00
Matthew Dillon
0cddd8f023 With Alfred's permission, remove vm_mtx in favor of a fine-grained approach
(this commit is just the first stage).  Also add various GIANT_ macros to
formalize the removal of Giant, making it easy to test in a more piecemeal
fashion. These macros will allow us to test fine-grained locks to a degree
before removing Giant, and also after, and to remove Giant in a piecemeal
fashion via sysctl's on those subsystems which the authors believe can
operate without Giant.
2001-07-04 16:20:28 +00:00
Yoshihiro Takahashi
f44a4f377e - Don't overwrite inb, inw and outw.
- Move the lance_probe function to if_lnc.c.
- Support C-NET(98)S again.

Submitted by:		chi@bd.mbn.or.jp (Chiharu Shibata) and nyan
No response from:	Paul Richards
2001-07-04 13:00:21 +00:00
Matt Jacob
555451d3c8 Add code, imperfect though it may be, for CAM_NEW_TRAN_CODE compilation. 2001-07-04 05:01:21 +00:00
Cameron Grant
41a019c08d * simplify
* add support for mic record channel

* add support for setblocksize

* make mpsafe

* make getptr accurate

* reduce buffer size from 64k to 16k for better synchronisation
2001-07-03 17:27:13 +00:00
Cameron Grant
cbe7d6a3ed remove obsolete typedefs.
only define INTR_TYPE_AV if it is not already defined.
2001-07-03 12:53:09 +00:00
Brian Feldman
bc0e6469ff Correct obviously wrong mistakes. 2001-07-02 23:47:23 +00:00
Matt Jacob
5640e0ac5a make it compile again in -current 2001-07-02 17:36:11 +00:00
Brian Feldman
5e6abe66d8 Detect the device on e.g. Dell OptiPlex GX110s. 2001-07-02 15:29:38 +00:00
Brian Feldman
0cfa4761f7 Make all this compile on 4.3, modulus sbuf. 2001-07-02 15:27:28 +00:00
Benno Rice
e5a44502dd Add device ID for the OHCI controller in the Apple KeyLargo chip. 2001-07-02 14:03:25 +00:00
Yoshihiro Takahashi
bf23a1be12 Fixed to support C-NET(9N)E. 2001-07-02 10:14:57 +00:00
Warner Losh
e58e069802 Minor style(9) changes before I get going. 2001-07-02 06:12:59 +00:00
Warner Losh
e51a61e842 Fix a couple of compile warnings because WLDEBUG and WLCACHE were
not defined.
2001-07-02 06:02:39 +00:00
Warner Losh
cf8a1123e4 Move wl driver to dev/wl. Repo copied to dev/wl, the old copies
removed and a minimal number of changes to make it compile in the new
location.

# I have a fully converted on a disk that may be crashed.  If it is
# crashed, I'll redo the work.
2001-07-02 05:58:47 +00:00
Warner Losh
4442d34e46 Repo copy i82586.h to dev/ic/i82586.h.
This file currently is very ie specific, but I have plans to change
that...
2001-07-02 05:29:58 +00:00
Cameron Grant
1b6c76a2fe intel ich/ich2 driver - this needs some work but is functional enough for
the impatient.

Hardware...
Provided by:    ps
Lost by:        <censored>
Found by:       <censored>
Not delivered by:       Ashley Penney <ashp@unloved.org>
Retrieved by:   greid, Andrew McKay <andy@openirc.co.uk>
Delivered by:   Andrew McKay <andy@openirc.co.uk>

PR:             kern/25507
Submitted by:   Katsurajima Naoto <raven@katsurajima.seya.yokohama.jp>
2001-07-01 19:38:58 +00:00
Cameron Grant
113375dc42 add module version/dependancies 2001-07-01 18:59:15 +00:00
Cameron Grant
c76f01164f don't set a flag that is already set 2001-07-01 18:57:16 +00:00
Cameron Grant
4712b1eba1 set default 'monitor' volume (ac97 headphones) to 75% 2001-07-01 18:53:24 +00:00