Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/tadpolectl Add serial port power management (hw.ser...



details:   https://anonhg.NetBSD.org/src/rev/5016dfb37fc0
branches:  trunk
changeset: 483642:5016dfb37fc0
user:      jdc <jdc%NetBSD.org@localhost>
date:      Tue Mar 14 21:27:41 2000 +0000

description:
Add serial port power management (hw.serial.power).

diffstat:

 usr.sbin/tadpolectl/tadpolectl.8 |   3 ++-
 usr.sbin/tadpolectl/tadpolectl.c |  21 +++++++++++++++++++--
 2 files changed, 21 insertions(+), 3 deletions(-)

diffs (67 lines):

diff -r 23d67becefae -r 5016dfb37fc0 usr.sbin/tadpolectl/tadpolectl.8
--- a/usr.sbin/tadpolectl/tadpolectl.8  Tue Mar 14 21:24:54 2000 +0000
+++ b/usr.sbin/tadpolectl/tadpolectl.8  Tue Mar 14 21:27:41 2000 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: tadpolectl.8,v 1.1 1999/12/17 05:30:02 garbled Exp $
+.\" $NetBSD: tadpolectl.8,v 1.2 2000/03/14 21:27:41 jdc Exp $
 .\" Copyright (c) 1999 The NetBSD Foundation, Inc.
 .\" All rights reserved.
 .\"
@@ -118,6 +118,7 @@
 .It hw.mouse.intclick  yes     yes
 .It hw.mouse.extclick  yes     yes
 .It hw.mouse.sensitivity       yes     yes
+.It hw.serial.power    yes     yes
 .El
 .Sh EXAMPLES
 .Pp
diff -r 23d67becefae -r 5016dfb37fc0 usr.sbin/tadpolectl/tadpolectl.c
--- a/usr.sbin/tadpolectl/tadpolectl.c  Tue Mar 14 21:24:54 2000 +0000
+++ b/usr.sbin/tadpolectl/tadpolectl.c  Tue Mar 14 21:27:41 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tadpolectl.c,v 1.3 2000/02/23 11:33:58 jdc Exp $ */
+/* $NetBSD: tadpolectl.c,v 1.4 2000/03/14 21:27:41 jdc Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -86,8 +86,9 @@
 PROTO(hw_mouse_intclick)
 PROTO(hw_mouse_extclick)
 PROTO(hw_mouse_sensitivity)
+PROTO(hw_serial_power)
 
-#define NUM_MIBS 28
+#define NUM_MIBS 29
 #define TABLE(n) { __STRING(n), 0, n }
 
 struct {
@@ -123,6 +124,7 @@
        TABLE(hw_mouse_intclick),
        TABLE(hw_mouse_extclick),
        TABLE(hw_mouse_sensitivity),
+       TABLE(hw_serial_power),
 };
 
 #define FUNC(x) \
@@ -653,6 +655,21 @@
        return(1);
 }
 
+FUNC(hw_serial_power)
+{
+       struct tctrl_pwr pwrreq;
+
+       if (!read) {
+               pwrreq.rw = 0x00;
+               pwrreq.state = new;
+               ioctl(dev, TCTRL_SERIAL_PWR, &pwrreq);
+       }
+       pwrreq.rw = 0x01;
+       ioctl(dev, TCTRL_SERIAL_PWR, &pwrreq);
+       table[num].value = pwrreq.state;
+       return(1);
+}
+
 void
 usage()
 {



Home | Main Index | Thread Index | Old Index