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

This commit is contained in:
jdc 2000-03-14 21:27:41 +00:00
parent e8a33a63d1
commit 6f9a44ec3e
2 changed files with 21 additions and 3 deletions

View File

@ -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. .\" Copyright (c) 1999 The NetBSD Foundation, Inc.
.\" All rights reserved. .\" All rights reserved.
.\" .\"
@ -118,6 +118,7 @@ privilege can change the value, and if a displayed value is valid.
.It hw.mouse.intclick yes yes .It hw.mouse.intclick yes yes
.It hw.mouse.extclick yes yes .It hw.mouse.extclick yes yes
.It hw.mouse.sensitivity yes yes .It hw.mouse.sensitivity yes yes
.It hw.serial.power yes yes
.El .El
.Sh EXAMPLES .Sh EXAMPLES
.Pp .Pp

View File

@ -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. * Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -86,8 +86,9 @@ PROTO(hw_kbd_click)
PROTO(hw_mouse_intclick) PROTO(hw_mouse_intclick)
PROTO(hw_mouse_extclick) PROTO(hw_mouse_extclick)
PROTO(hw_mouse_sensitivity) PROTO(hw_mouse_sensitivity)
PROTO(hw_serial_power)
#define NUM_MIBS 28 #define NUM_MIBS 29
#define TABLE(n) { __STRING(n), 0, n } #define TABLE(n) { __STRING(n), 0, n }
struct { struct {
@ -123,6 +124,7 @@ struct {
TABLE(hw_mouse_intclick), TABLE(hw_mouse_intclick),
TABLE(hw_mouse_extclick), TABLE(hw_mouse_extclick),
TABLE(hw_mouse_sensitivity), TABLE(hw_mouse_sensitivity),
TABLE(hw_serial_power),
}; };
#define FUNC(x) \ #define FUNC(x) \
@ -653,6 +655,21 @@ FUNC(hw_version)
return(1); 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 void
usage() usage()
{ {