Commit Graph

647 Commits

Author SHA1 Message Date
chs ac3bc537bd eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS			0
KERN_INVALID_ADDRESS		EFAULT
KERN_PROTECTION_FAILURE		EACCES
KERN_NO_SPACE			ENOMEM
KERN_INVALID_ARGUMENT		EINVAL
KERN_FAILURE			various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE		ENOMEM
KERN_NOT_RECEIVER		<unused>
KERN_NO_ACCESS			<unused>
KERN_PAGES_LOCKED		<unused>
2001-03-15 06:10:32 +00:00
scottr 054277902e Correct a thinko: iteopen()/iteclose() shouldn't just pass off to
the wsdisplay driver.  Otherwise, closing ttye0 (ite compat) ends
up closing ttyE0, the actual console, when ttyflags runs.  Fixes
PR 12022.
2001-01-22 07:31:44 +00:00
scottr 1609858811 The Cuda-based ADB hardware has the ability to queue some commands and
return control to the main CPU before completing the ADB transaction.
Double the adb_op_sync() timeout as a result.  Fixes PR 11310.
2000-11-15 06:35:51 +00:00
thorpej b84f740be0 Move bpfattach()/bpfdetach() calls into ether_ifattach()/ether_ifdetach(). 2000-11-15 01:02:11 +00:00
scottr a7a5cd8399 Replace the call to macfb_init() when attaching a non-console fb device
with a call to macfb_clear().

[The purpose of macfb_init() is almost exclusively to initialize the
raster console blitter.  We really, really do not want to do this unless
we are actually initializing the console device, else we'll give rcons
the attributes of the last-seen fb device.  These will not necessarily
correspond to the attributes of the actual console device!]
2000-10-22 05:05:39 +00:00
thorpej 7ca3fb9ef0 Move the check for "promisc + unicast + not for us" into ether_input(),
and change Ethernet drivers to always pass all received frames to
ether_input() (with a few exceptions, which are documented in the
code).
2000-10-01 23:32:39 +00:00
scottr 2c7ec6839c In ems_init(): make sure there's valid data in the buffer after sending
a TALK command to a device.  Noticed by Ken'ichi Ishizaka.
2000-10-01 05:10:57 +00:00
scottr 489ed1a908 The Duo ADB controller doesn't notify us that it needs to be polled
through the (emulated) VIA.  Work around this problem by polling the
Power Manager chip directly.  From Daishi Kato, PR 9852.
2000-09-27 03:57:51 +00:00
scottr 29923311f1 Set up ADB hardware type before making decisions based on same.
This is part of PR 9852 from Daishi Kato.
2000-09-27 03:27:23 +00:00
scottr 7c2fc39588 Now that we do collision detection and assign all ADB devices to distinct
addresses, it makes sense to print the actual address of the device rather
than the original address.  The latter is useful to distinguish the type
of device only, so we maintain that data internally (as we always have).

This closes PR 10557 from Dave Huang.
2000-09-27 03:22:05 +00:00
scottr 7eec1b2d04 Attach exactly one keyboard to the wscons console. 2000-09-22 04:56:54 +00:00
scottr e4b50d9bfc Ken'ichi Ishizaka discovered that some devices, e.g. the A3 Mouse, don't
respond in the allotted time if they're told to TALK immediately after
completing a LISTEN command.  Experimentation with adb_op_sync() yielded
consistent results when the timeout was increased from the documented
6900 usec to 8000 usec, so we'll make that change here.

(Accurate and complete documentation of the hardware sure would help...)
2000-09-19 05:17:55 +00:00
scottr ff2130346c Resolve bus_space_write_region_2() type mismatches. 2000-09-13 05:21:16 +00:00
scottr 7eb72c4f15 ae_write_mbuf() broke with the last change; revert. 2000-09-13 05:16:47 +00:00
briggs fb9995989b Make bus_space_write_region_2 usage match prototype. 2000-07-30 21:41:59 +00:00
scottr d08e3b12a4 Stabilize ADB support for some non-Apple ADB peripherals. This is the
second (and final) part of the fix for PR 10086.  (There are no longer
any infinite-wait busy loops in the ADB driver!)
2000-07-03 08:59:26 +00:00
mrg 28d898391b remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h> 2000-06-29 08:10:45 +00:00
simonb 889c658b5b Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes.  Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
2000-06-26 04:55:19 +00:00
wrstuden 491d7e6764 Fix logic bug which would keep PPS from working. Noticed by:
Charles Carvalho <carvalho@cisco.com>
2000-06-25 20:55:33 +00:00
scottr fbafc16812 Revert debug-related bogon that snuck in (no change in functionality). 2000-06-18 22:58:45 +00:00
scottr cee7249423 Since interrupts are now enabled during ADB autoconfig, it's possible to get
a keyboard event before wskbd is attached. Make sure we've done that before
passing an event to kbd_intr(), which in turn hands off to wskbd_input().
This is another part of the fix for PR 10086.
2000-06-17 18:00:47 +00:00
scottr 6f644439a9 Only the first device that we're sure is a keyboard should be attached
as the wskbd console device.  (Part of the fix for PR 10086.)
2000-06-17 17:46:40 +00:00
scottr 50cde82828 Since interrupts are now enabled during ADB autoconfig, it's possible
to get a mouse event before wsmouse is attached. Make sure we've done
that before passing an event to wsmouse_input().
2000-06-11 17:26:47 +00:00
scottr d220ba7dc4 Make this compile with GRF_COMPAT. Problem pointed out by Hauke Fath. 2000-06-08 06:01:27 +00:00
scottr 3ca0215f69 Correct a pasto in pm_pmgrop_pm1(); while there were no negative side
effects, the place this code ended up couldn't have had any positive
effect, either.
2000-04-05 07:29:18 +00:00
scottr 15a3a17a43 Correct a few instances where we returned from a function that
had set splhigh() but returned without restoring the previous spl.
The PowerBook keyboard works better, now, but still starts to flake
out pretty badly at 70+ wpm.
2000-04-05 07:18:07 +00:00
thorpej b667a5a357 New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
  resource allocation.
- Insertion and removal of callouts is constant time, important as
  this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
2000-03-23 06:30:07 +00:00
scottr 4f29e4d330 Add and use macros to build ADB FLUSH, LISTEN, and TALK commands. 2000-03-19 07:37:58 +00:00
scottr edfc8b89ad The MRG and direct ADB drivers were inconsistent in how they worked with
a serial console; the direct driver didn't care, but the MRG driver
wouldn't probe ADB when using a serial console.  Remove the check from
the MRG version of the code to resolve this difference.
2000-03-19 06:07:05 +00:00
mycroft 0af581a1a1 Add a ncr5380_attach() routine which does part of the initialization, attaches
the scsibus, and does the addref/delref dance.
2000-03-18 16:13:22 +00:00
scottr c62e39490c Check to make sure we get a valid handler ID in response to a TALK R3. 2000-03-18 08:07:50 +00:00
scottr 0a23aef85e Resurrect a chunk of code from the ite driver that we lost along the way.
This code is necessary for SE/30 internal video, at a minimum.
2000-03-17 04:46:32 +00:00
scottr 6755970bcf Low-level drivers, like the Power Manager driver, can get us into a major
funk when they misbehave and give us unexpected results.  Specifically:

 - Don't assume that the first free slot is at the top of the table if
   we can't find one.
 - Don't increment ADBNumDevices when backfilling "holes" left by devices
   that didn't respond to a TALK R3 during the initial device scan.
 - Don't assume that an address reassignment worked; make sure something
   responds on the new address before plowing forward.
 - If after device reassignment there are no free slots, make sure to
   indicate this fact.
 - Failing all else, handle the situation where we run out of slots in
   the device table -- which now should "never" happen -- gracefully.

While the Power Manager driver still sometimes misbehaves, it shouldn't
cause the system to crash/hang due to us walking off the end of the
device table.
2000-03-07 06:35:22 +00:00
scottr 5c7674d4dd Explicitly include headers needed by iopreg.h 2000-02-21 02:04:48 +00:00
scottr ab647533a1 Bracket disabled IIfx IOP code with #ifdef __notyet__, rather than
commenting it out or using #if 0.
2000-02-21 01:20:55 +00:00
ender f30d8c9d30 Include mac68k/dev/akbdmap.h, not macppc/dev/akbdmap.h. Fixes PR 9435
filed by Dave Huang <khym@bga.com>.
2000-02-17 02:07:07 +00:00
scottr 8a00740789 Merge wscons work onto the main development branch. 2000-02-14 07:01:44 +00:00
scottr 97a60329d2 Apparently, the Mac TV is a re-packaged Performa 550. Add code to
recognize this so that Mac TV users can finally ditch the MRG_ADB option.
1999-12-25 08:16:34 +00:00
scottr 1c5a093819 Make this compile without bpf. Problem noted by Bob Nestor, fix from
Frederick Bruckman.
1999-12-20 01:06:40 +00:00
scottr 3310f57beb Replace references to PGOFSET with m68k_trunc_page() and m68k_page_offset(),
as appropriate.
1999-12-12 08:18:48 +00:00
scottr a15eb6dc13 An interrupt handler may change adbInCount underneath us, so qualify the declaration
with volatile.  The bug didn't show its face until more agressive
optimization showed up, apparently a result of the last egcs upgrade.
(The interrupt handling changes from June have certainly also played
a part.)  Thanks to Ken'ichi Ishizaka for discovering the problem.
1999-12-10 00:03:47 +00:00
scottr 99d3468790 Don't use the plural form of the word "target" if there is only one! 1999-11-28 10:10:51 +00:00
scottr dc2663bf69 If there is only one ADB device, it will do us no good to avoid it
when guessing which device to poll next.  Resolves PR 7407, but the
bug is a lot older than that.
1999-11-28 10:07:34 +00:00
scottr 4ecba735df Garbage collect adb_initted. 1999-11-07 08:22:50 +00:00
scottr 0b8b3c403e In the interrupt handlers, check adb_polling instead of
adb_initted to decide whether to handle 'recovered' interrupts
immediately.
1999-11-07 08:18:24 +00:00
scottr 26208b5e57 Garbage-collect adb_init(). It's been dead for a long time. 1999-11-07 08:08:10 +00:00
scottr c11dd8b6dd We want adb_polling set regardless of whether we're using the MRG driver. 1999-11-07 08:07:20 +00:00
scottr 8da942f249 Oops... last rev created an unused variable. While here, clean up
adb_reinit()'s variables a bit, too.
1999-11-07 06:15:09 +00:00
scottr 23411c4c1b Convert one more buffer copy that I missed in rev 1.28. 1999-11-07 05:50:26 +00:00
scottr a7628ea793 Always using polling for poweroff (from macppc). 1999-11-07 00:16:39 +00:00