diff options
author | imp <imp@FreeBSD.org> | 1998-07-06 06:29:07 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 1998-07-06 06:29:07 +0000 |
commit | d1c7cd559fde7fd681b94ef7ab61b27a78d40bd0 (patch) | |
tree | d830b5d5eaf1867a83baf416172d0ae784546c19 /sys/isa | |
parent | 3b5d08a30e5213746fe169860aaa6a77bfd9aee3 (diff) | |
download | FreeBSD-src-d1c7cd559fde7fd681b94ef7ab61b27a78d40bd0.zip FreeBSD-src-d1c7cd559fde7fd681b94ef7ab61b27a78d40bd0.tar.gz |
Add the ability to suspend as well as hibernate to the system. This
is the kernel part of my commits, the userlevel stuff will be done in
a separate commit. Add the ability to suspend as well as hibernate to
syscons. Create a new virtual key like hibernate for suspend. Update
apm_bios.h to define more apm bios goodies.
Diffstat (limited to 'sys/isa')
-rw-r--r-- | sys/isa/syscons.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/sys/isa/syscons.c b/sys/isa/syscons.c index de7e370..8f11058 100644 --- a/sys/isa/syscons.c +++ b/sys/isa/syscons.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: syscons.c,v 1.263 1998/06/13 18:53:22 steve Exp $ + * $Id: syscons.c,v 1.264 1998/06/24 10:21:30 yokota Exp $ */ #include "sc.h" @@ -528,6 +528,7 @@ sckbdprobe(int unit, int flags) int codeset; int c = -1; int m; + int res, id; sc_kbdc = kbdc_open(sc_port); @@ -664,6 +665,17 @@ sckbdprobe(int unit, int flags) printf("sc%d: unable to enable the keyboard port and intr.\n", unit); goto fail; } + + /* Get the ID of the keyboard, if any */ + empty_kbd_buffer(sc_kbdc, 5); + res = send_kbd_command(sc_kbdc, KBDC_SEND_DEV_ID); + if (res == KBD_ACK) { + /* 10ms delay */ + DELAY(10000); + id = (read_kbd_data(sc_kbdc) << 8) | read_kbd_data(sc_kbdc); + if (bootverbose) + printf("sc%d: keyboard device ID: %04x\n", unit, id); + } kbdc_set_device_mask(sc_kbdc, m | KBD_KBD_CONTROL_BITS), kbdc_lock(sc_kbdc, FALSE); @@ -3980,7 +3992,14 @@ next_code: case SUSP: #if NAPM > 0 accents = 0; - apm_suspend(); + apm_suspend(PMST_SUSPEND); +#endif + break; + + case STBY: +#if NAPM > 0 + accents = 0; + apm_suspend(PMST_STANDBY); #endif break; |