summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-04-29 14:13:54 +0300
committerToomas Soome <tsoome@me.com>2019-05-16 22:36:52 +0300
commitc0423dd8ef7079a845a1aa3ceb20e565e815f97b (patch)
tree9f8888d60286b10060d1d3944782a08819ce398a
parente3f3c0e614a8cd74d4212f4c7c616ed5b3cf00cb (diff)
downloadillumos-joyent-c0423dd8ef7079a845a1aa3ceb20e565e815f97b.tar.gz
10884 kbd: add option to limit autorepeat count, convert manual
Reviewed by: Peter Tribble <peter.tribble@gmail.com> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/cmd/kbd/kbd.c108
-rw-r--r--usr/src/cmd/kbd/keymap.xml11
-rw-r--r--usr/src/cmd/truss/codes.c24
-rw-r--r--usr/src/man/man1/kbd.1954
-rw-r--r--usr/src/uts/common/io/kbtrans/kbtrans_streams.c37
-rw-r--r--usr/src/uts/common/os/streamio.c8
-rw-r--r--usr/src/uts/common/sys/kbio.h10
7 files changed, 501 insertions, 651 deletions
diff --git a/usr/src/cmd/kbd/kbd.c b/usr/src/cmd/kbd/kbd.c
index da9c3b7fba..8017716b91 100644
--- a/usr/src/cmd/kbd/kbd.c
+++ b/usr/src/cmd/kbd/kbd.c
@@ -25,8 +25,8 @@
/*
* Usage: kbd [-r] [-t] [-l] [-c on|off] [-a enable|disable|alternate]
- * [-d keyboard device] [-D autorepeat dealy] [-R autorepeat
- * rate]
+ * [-d keyboard device] [-A autorepeat count]
+ * [-D autorepeat delay] [-R autorepeat rate]
* kbd [-i] [-d keyboard device]
* kbd -s [language]
* kbd -b [keyboard|console] frequency
@@ -37,7 +37,8 @@
* -i read in the default configuration file
* -c on|off turn on|off clicking
* -a enable|disable|alternate sets abort sequence
- * -D autorepeat delay sets autorepeat dealy, unit in ms
+ * -A autorepeat count sets autorepeat sequence length in chars.
+ * -D autorepeat delay sets autorepeat delay, unit in ms
* -R autorepeat rate sets autorepeat rate, unit in ms
* -d keyboard device chooses the kbd device, default /dev/kbd.
* -s keyboard layout sets keyboard layout
@@ -61,6 +62,7 @@
#include <errno.h>
#include <inttypes.h>
#include <libscf.h>
+#include <limits.h>
#define KBD_DEVICE "/dev/kbd" /* default keyboard device */
@@ -76,6 +78,7 @@
#define KBD_PROP_KEYBOARD_ABORT "keyboard_abort"
#define KBD_PROP_RPTDELAY "repeat_delay"
#define KBD_PROP_RPTRATE "repeat_rate"
+#define KBD_PROP_RPTCOUNT "repeat_count"
#define KBD_PROP_FREQ "kbd_beeper_freq"
#define KBD_PROP_CONSFREQ "console_beeper_freq"
#define KBD_MAX_NAME_LEN 1024
@@ -93,6 +96,8 @@ static void usage(void);
static int click(char *, int);
static int abort_enable(char *, int);
+static int set_repeat_count(char *, int);
+static int set_rptcount(int, int);
static int set_repeat_delay(char *, int);
static int set_rptdelay(int, int);
static int set_repeat_rate(char *, int);
@@ -109,16 +114,17 @@ main(int argc, char **argv)
{
int c, error;
int rflag, tflag, lflag, cflag, dflag, aflag, iflag, errflag,
- Dflag, Rflag, rtlacDRflag, sflag, bflag;
- char *copt, *aopt, *delay, *rate, *layout_name, *b_type, *freq_str;
+ Aflag, Dflag, Rflag, rtlacADRflag, sflag, bflag;
+ char *copt, *aopt, *count, *delay, *rate, *layout_name, *b_type;
+ char *freq_str;
char *kbdname = KBD_DEVICE, *endptr = NULL;
int kbd, freq_val;
extern char *optarg;
extern int optind;
rflag = tflag = cflag = dflag = aflag = iflag = errflag = lflag =
- Dflag = Rflag = sflag = bflag = 0;
- copt = aopt = (char *)0;
+ Aflag = Dflag = Rflag = sflag = bflag = 0;
+ copt = aopt = NULL;
(void) setlocale(LC_ALL, "");
#if !defined(TEXT_DOMAIN)
@@ -126,7 +132,7 @@ main(int argc, char **argv)
#endif
(void) textdomain(TEXT_DOMAIN);
- while ((c = getopt(argc, argv, "rtlisc:a:d:D:R:b:")) != EOF) {
+ while ((c = getopt(argc, argv, "rtlisc:a:d:A:D:R:b:")) != EOF) {
switch (c) {
case 'r':
rflag++;
@@ -155,6 +161,10 @@ main(int argc, char **argv)
kbdname = optarg;
dflag++;
break;
+ case 'A':
+ count = optarg;
+ Aflag++;
+ break;
case 'D':
delay = optarg;
Dflag++;
@@ -186,15 +196,22 @@ main(int argc, char **argv)
/*
* kbd requires that the user specify either "-i" or "-s" or "-b" or
- * at least one of -[rtlacDR]. The "-d" option is, well, optional.
+ * at least one of -[rtlacADR]. The "-d" option is, well, optional.
* We don't care if it's there or not.
*/
- rtlacDRflag = rflag + tflag + lflag + aflag + cflag + Dflag + Rflag;
- if (!((iflag != 0 && sflag == 0 && bflag == 0 && rtlacDRflag == 0) ||
+ rtlacADRflag = rflag + tflag + lflag + aflag + cflag + Aflag +
+ Dflag + Rflag;
+ if (!((iflag != 0 && sflag == 0 && bflag == 0 && rtlacADRflag == 0) ||
(iflag == 0 && sflag != 0 && bflag == 0 && dflag == 0 &&
- rtlacDRflag == 0) ||
- (iflag == 0 && sflag == 0 && bflag == 0 && rtlacDRflag != 0) ||
- (iflag == 0 && sflag == 0 && bflag != 0 && rtlacDRflag == 0))) {
+ rtlacADRflag == 0) ||
+ (iflag == 0 && sflag == 0 && bflag == 0 && rtlacADRflag != 0) ||
+ (iflag == 0 && sflag == 0 && bflag != 0 && rtlacADRflag == 0))) {
+ usage();
+ exit(1);
+ }
+
+ if (Aflag && atoi(count) < -1) {
+ (void) fprintf(stderr, "Invalid arguments: -A %s\n", count);
usage();
exit(1);
}
@@ -241,6 +258,9 @@ main(int argc, char **argv)
if (aflag && (error = abort_enable(aopt, kbd)) != 0)
exit(error);
+ if (Aflag && (error = set_repeat_count(count, kbd)) != 0)
+ exit(error);
+
if (Dflag && (error = set_repeat_delay(delay, kbd)) != 0)
exit(error);
@@ -483,8 +503,8 @@ get_layout(int kbd)
{
int kbd_type;
int kbd_layout;
- /* these two variables are used for getting delay&rate */
- int delay, rate;
+ /* these three variables are used for getting delay&rate&count */
+ int delay, rate, count = -1;
delay = rate = 0;
if (ioctl(kbd, KIOCTYPE, &kbd_type)) {
@@ -511,8 +531,17 @@ get_layout(int kbd)
exit(1);
}
+ if (ioctl(kbd, KIOCGRPTCOUNT, &count)) {
+ perror("ioctl (kbd get repeat count)");
+ exit(1);
+ }
+
(void) printf("delay(ms)=%d\n", delay);
(void) printf("rate(ms)=%d\n", rate);
+ if (count == -1)
+ (void) printf("count=unlimited\n");
+ else
+ (void) printf("count=%d\n", count);
}
/*
@@ -568,6 +597,24 @@ abort_enable(char *aopt, int kbd)
}
static int
+set_rptcount(int count, int kbd)
+{
+ if (ioctl(kbd, KIOCSRPTCOUNT, &count) == -1) {
+ perror("kbd: set repeat count");
+ return (1);
+ }
+ return (0);
+}
+
+static int
+set_repeat_count(char *count_str, int kbd)
+{
+ int count = atoi(count_str);
+
+ return (set_rptcount(count, kbd));
+}
+
+static int
set_rptdelay(int delay, int kbd)
{
/*
@@ -643,7 +690,7 @@ kbd_defaults(int kbd)
int layout_num;
char *val_layout = NULL, *val_abort = NULL;
uint8_t val_click;
- int64_t val_delay, val_rate;
+ int64_t val_delay, val_rate, val_count;
int64_t val_kbd_beeper, val_console_beeper;
if ((h = scf_handle_create(SCF_VERSION)) == NULL ||
@@ -715,6 +762,18 @@ kbd_defaults(int kbd)
KBD_PROP_KEYBOARD_ABORT, val_abort);
}
+ if (scf_pg_get_property(pg, KBD_PROP_RPTCOUNT, prop) != 0 ||
+ scf_property_get_value(prop, val) != 0 ||
+ scf_value_get_integer(val, &val_count) == -1) {
+ (void) fprintf(stderr, "Can not get RPTCOUNT\n");
+ }
+
+ if (val_count == -1 || (val_count > 0 && val_count < INT_MAX))
+ (void) set_rptcount(val_count, kbd);
+ else
+ (void) fprintf(stderr,
+ BAD_DEFAULT_LLINT, KBD_PROP_RPTCOUNT, val_count);
+
if (scf_pg_get_property(pg, KBD_PROP_RPTDELAY, prop) != 0 ||
scf_property_get_value(prop, val) != 0 ||
scf_value_get_integer(val, &val_delay) == -1) {
@@ -869,15 +928,16 @@ set_layout(int kbd, int layout_num)
return (0);
}
-static char *usage1 = "kbd [-r] [-t] [-l] [-a enable|disable|alternate]";
-static char *usage2 = " [-c on|off][-D delay][-R rate][-d keyboard device]";
-static char *usage3 = "kbd -i [-d keyboard device]";
-static char *usage4 = "kbd -s [language]";
-static char *usage5 = "kbd -b [keyboard|console] frequency";
+static char *usage1 =
+ "kbd [-r] [-t] [-l] [-a enable|disable|alternate] [-c on|off]\n"
+ "\t [-d keyboard device] [-A count] [-D delay] [-R rate]";
+static char *usage2 = "kbd -i [-d keyboard device]";
+static char *usage3 = "kbd -s [language]";
+static char *usage4 = "kbd -b [keyboard|console] frequency";
static void
usage(void)
{
- (void) fprintf(stderr, "Usage:\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n", usage1,
- usage2, usage3, usage4, usage5);
+ (void) fprintf(stderr, "Usage:\t%s\n\t%s\n\t%s\n\t%s\n", usage1,
+ usage2, usage3, usage4);
}
diff --git a/usr/src/cmd/kbd/keymap.xml b/usr/src/cmd/kbd/keymap.xml
index 04b127c09f..c6ec168c28 100644
--- a/usr/src/cmd/kbd/keymap.xml
+++ b/usr/src/cmd/kbd/keymap.xml
@@ -75,6 +75,7 @@
<property_group name='keymap' type='system'>
<propval name='keyboard_abort' type='astring' value='enable' />
<propval name='keyclick' type='boolean' value='false' />
+ <propval name='repeat_count' type='integer' value='-1' />
<propval name='repeat_delay' type='integer' value='500' />
<propval name='repeat_rate' type='integer' value='40' />
<propval name='layout' type='astring' value='US-English' />
@@ -123,7 +124,7 @@
<prop_pattern name='repeat_delay' type='integer' required='true'>
<description>
<loctext xml:lang='C'>
- The autorepeat delay
+ The autorepeat delay
</loctext>
</description>
<cardinality min="1" max="1"/>
@@ -131,7 +132,7 @@
<prop_pattern name='repeat_rate' type='integer' required='true'>
<description>
<loctext xml:lang='C'>
- The autorepeat rate
+ The autorepeat rate
</loctext>
</description>
<cardinality min="1" max="1"/>
@@ -139,7 +140,7 @@
<prop_pattern name='layout' type='astring' required='true'>
<description>
<loctext xml:lang='C'>
- The keyboard layout
+ The keyboard layout
</loctext>
</description>
<cardinality min="1" max="1"/>
@@ -147,7 +148,7 @@
<prop_pattern name='kbd_beeper_freq' type='integer' required='true'>
<description>
<loctext xml:lang='C'>
- Keyboard beeper frequency
+ Keyboard beeper frequency
</loctext>
</description>
<cardinality min="1" max="1"/>
@@ -158,7 +159,7 @@
<prop_pattern name='console_beeper_freq' type='integer' required='true'>
<description>
<loctext xml:lang='C'>
- Console beeper frequency
+ Console beeper frequency
</loctext>
</description>
<cardinality min="1" max="1"/>
diff --git a/usr/src/cmd/truss/codes.c b/usr/src/cmd/truss/codes.c
index ff2389ea55..ac49896686 100644
--- a/usr/src/cmd/truss/codes.c
+++ b/usr/src/cmd/truss/codes.c
@@ -28,7 +28,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
#include <stdio.h>
@@ -870,7 +870,7 @@ const struct ioc {
{ (uint_t)SIOCGLIFGROUPINFO, "SIOCGLIFGROUPINFO", "lifgroupinfo" },
{ (uint_t)SIOCGDSTINFO, "SIOCGDSTINFO", NULL },
{ (uint_t)SIOCGIP6ADDRPOLICY, "SIOCGIP6ADDRPOLICY", NULL },
- { (uint_t)SIOCSIP6ADDRPOLICY, "SIOCSIP6ADDRPOLICY", NULL },
+ { (uint_t)SIOCSIP6ADDRPOLICY, "SIOCSIP6ADDRPOLICY", NULL },
{ (uint_t)SIOCSXARP, "SIOCSXARP", "xarpreq" },
{ (uint_t)SIOCGXARP, "SIOCGXARP", "xarpreq" },
{ (uint_t)SIOCDXARP, "SIOCDXARP", "xarpreq" },
@@ -893,15 +893,15 @@ const struct ioc {
{ (uint_t)SIOCGLIFHWADDR, "SIOCGLIFHWADDR", "lifreq" },
/* DES encryption */
- { (uint_t)DESIOCBLOCK, "DESIOCBLOCK", "desparams" },
- { (uint_t)DESIOCQUICK, "DESIOCQUICK", "desparams" },
+ { (uint_t)DESIOCBLOCK, "DESIOCBLOCK", "desparams" },
+ { (uint_t)DESIOCQUICK, "DESIOCQUICK", "desparams" },
/* Printing system */
- { (uint_t)PRNIOC_GET_IFCAP, "PRNIOC_GET_IFCAP", NULL },
- { (uint_t)PRNIOC_SET_IFCAP, "PRNIOC_SET_IFCAP", NULL },
+ { (uint_t)PRNIOC_GET_IFCAP, "PRNIOC_GET_IFCAP", NULL },
+ { (uint_t)PRNIOC_SET_IFCAP, "PRNIOC_SET_IFCAP", NULL },
{ (uint_t)PRNIOC_GET_IFINFO, "PRNIOC_GET_IFINFO",
"prn_interface_info" },
- { (uint_t)PRNIOC_GET_STATUS, "PRNIOC_GET_STATUS", NULL },
+ { (uint_t)PRNIOC_GET_STATUS, "PRNIOC_GET_STATUS", NULL },
{ (uint_t)PRNIOC_GET_1284_DEVID, "PRNIOC_GET_1284_DEVID",
"prn_1284_device_id" },
{ (uint_t)PRNIOC_GET_1284_STATUS,
@@ -910,7 +910,7 @@ const struct ioc {
"prn_timeouts" },
{ (uint_t)PRNIOC_SET_TIMEOUTS, "PRNIOC_SET_TIMEOUTS",
"prn_timeouts" },
- { (uint_t)PRNIOC_RESET, "PRNIOC_RESET", NULL },
+ { (uint_t)PRNIOC_RESET, "PRNIOC_RESET", NULL },
/* DTrace */
{ (uint_t)DTRACEIOC_PROVIDER, "DTRACEIOC_PROVIDER", NULL },
@@ -1070,6 +1070,8 @@ const struct ioc {
{ (uint_t)KIOCSLAYOUT, "KIOCSLAYOUT", NULL },
{ (uint_t)KIOCLAYOUT, "KIOCLAYOUT", NULL },
{ (uint_t)KIOCSKABORTEN, "KIOCSKABORTEN", NULL },
+ { (uint_t)KIOCGRPTCOUNT, "KIOCGRPTCOUNT", NULL },
+ { (uint_t)KIOCSRPTCOUNT, "KIOCSRPTCOUNT", NULL },
{ (uint_t)KIOCGRPTDELAY, "KIOCGRPTDELAY", NULL },
{ (uint_t)KIOCSRPTDELAY, "KIOCSRPTDELAY", NULL },
{ (uint_t)KIOCGRPTRATE, "KIOCGRPTRATE", NULL },
@@ -1805,7 +1807,7 @@ si86name(int code)
case SI86DELMEM: str = "SI86DELMEM"; break;
case SI86ADDMEM: str = "SI86ADDMEM"; break;
/* 71 through 74 reserved for VPIX */
- case SI86V86: str = "SI86V86"; break;
+ case SI86V86: str = "SI86V86"; break;
case SI86SLTIME: str = "SI86SLTIME"; break;
case SI86DSCR: str = "SI86DSCR"; break;
case RDUBLK: str = "RDUBLK"; break;
@@ -1814,7 +1816,7 @@ si86name(int code)
case SI86VM86: str = "SI86VM86"; break;
case SI86VMENABLE: str = "SI86VMENABLE"; break;
case SI86LIMUSER: str = "SI86LIMUSER"; break;
- case SI86RDID: str = "SI86RDID"; break;
+ case SI86RDID: str = "SI86RDID"; break;
case SI86RDBOOT: str = "SI86RDBOOT"; break;
/* Merged Product defines */
case SI86SHFIL: str = "SI86SHFIL"; break;
@@ -1822,7 +1824,7 @@ si86name(int code)
case SI86BADVISE: str = "SI86BADVISE"; break;
case SI86SHRGN: str = "SI86SHRGN"; break;
case SI86CHIDT: str = "SI86CHIDT"; break;
- case SI86EMULRDA: str = "SI86EMULRDA"; break;
+ case SI86EMULRDA: str = "SI86EMULRDA"; break;
/* RTC commands */
case WTODC: str = "WTODC"; break;
case SGMTL: str = "SGMTL"; break;
diff --git a/usr/src/man/man1/kbd.1 b/usr/src/man/man1/kbd.1
index 1c8f3ea633..c0b753a7ca 100644
--- a/usr/src/man/man1/kbd.1
+++ b/usr/src/man/man1/kbd.1
@@ -3,566 +3,333 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH KBD 1 "Jan 29, 2007"
-.SH NAME
-kbd \- manipulate the state of keyboard, or display the type of keyboard, or
+.Dd April 29, 2019
+.Dt KBD 1
+.Os
+.Sh NAME
+.Nm kbd
+.Nd
+manipulate the state of keyboard, or display the type of keyboard, or
change the default keyboard abort sequence effect
-.SH SYNOPSIS
-.LP
-.nf
-\fBkbd\fR [\fB-r\fR] [\fB-t\fR ] [\fB-l\fR] [\fB-a\fR enable | disable | alternate]
- [\fB-c\fR on | off] [\fB-d\fR \fIkeyboard device\fR]
- [\fB-D\fR \fIautorepeat delay\fR] [\fB-R\fR \fIautorepeat rate\fR]
-.fi
-
-.LP
-.nf
-\fBkbd\fR [\fB-i\fR] [\fB-d\fR \fIkeyboard device\fR]
-.fi
-
-.LP
-.nf
-\fBkbd\fR \fB-s\fR [\fIlanguage\fR]
-.fi
-
-.LP
-.nf
-\fBkbd\fR \fB-b\fR [\fBkeyboard\fR | \fBconsole\fR] \fIfrequency\fR
-.fi
-
-.SH DESCRIPTION
-.LP
-The \fBkbd\fR utility manipulates the state of the keyboard, or displays the
+.Sh SYNOPSIS
+.Nm
+.Op Fl r
+.Op Fl t
+.Op Fl l
+.Op Fl a Ar enable | Ar disable | Ar alternate
+.Op Fl c Ar on | Ar off
+.Op Fl d Ar keyboard device
+.Op Fl A Ar autorepeat count
+.Op Fl D Ar autorepeat delay
+.Op Fl R Ar autorepeat rate
+.Nm
+.Op Fl i
+.Op Fl d Ar keyboard device
+.Nm
+.Fl s Op Ar language
+.Nm
+.Fl b Op Ar keyboard | Ar console
+.Ar frequency
+.Sh DESCRIPTION
+The
+.Nm
+utility manipulates the state of the keyboard, or displays the
keyboard type, or allows the default keyboard abort sequence effect to be
-changed. The abort sequence also applies to serial console devices. The
-\fBkbd\fR utility sets the \fB/dev/kbd\fR default keyboard device.
-.SH EXTENDED DESCRIPTION
-.LP
-The \fB-i\fR option reads and processes default values for the keyclick and
-keyboard abort settings from the \fB/etc/default/kbd\fR keyboard default file.
-Only keyboards that support a clicker respond to the \fB-c\fR option. To turn
-clicking on by default, add or change the value of the \fBKEYCLICK\fR variable
-in the \fB/etc/default/kbd\fR file to:
-.sp
-.in +2
-.nf
-KEYCLICK=on
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-Next, run the command \fBkbd\fR \fB-i\fR to change the setting. Valid settings
-for the \fBKEYCLICK\fR variable are \fBon\fR and \fBoff\fR; all other values
-are ignored. If the \fBKEYCLICK\fR variable is not specified in the default
-file, the setting is unchanged.
-.sp
-.LP
+changed.
+The abort sequence also applies to serial console devices.
+The
+.Nm
+utility sets the
+.Pa /dev/kbd
+default keyboard device.
+.Sh EXTENDED DESCRIPTION
+The
+.Fl i
+option reads and processes default values for the keyclick and
+keyboard abort settings from the keyboard configuration service,
+.Sy svc:/system/keymap:default .
+Only keyboards that support a clicker respond to the
+.Fl c
+option.
+.Pp
The keyboard abort sequence effect can only be changed by a super-user using
-the \fB-a\fR option. This sequence is typically Stop-A or L1-A and Shift-Pause
-on the keyboard on \fBSPARC\fR systems, F1-A and Shift-Pause on x86 systems,
+the
+.Fl a
+option.
+This sequence is typically Stop-A or L1-A and Shift-Pause on the keyboard on
+.Sy SPARC
+systems, F1-A and Shift-Pause on x86 systems,
and BREAK on the serial console input device on most systems.
-.sp
-.LP
-A \fBBREAK\fR condition that originates from an erroneous electrical signal
-cannot be distinguished from one deliberately sent by remote \fBDCE\fR. As a
-remedy, use the \fB-a\fR option with Alternate Break to switch break
-interpretation. Due to the risk of incorrect sequence interpretation, binary
-protocols such as \fBSLIP\fR and others should not be run over the serial
-console port when Alternate Break sequence is in effect.
-.sp
-.LP
+.Pp
+A
+.Sy BREAK
+condition that originates from an erroneous electrical signal
+cannot be distinguished from one deliberately sent by remote
+.Sy DCE .
+As a remedy, use the
+.Fl a
+option with Alternate Break to switch break interpretation.
+Due to the risk of incorrect sequence interpretation, binary
+protocols such as
+.Sy SLIP
+and others should not be run over the serial console port when Alternate Break
+sequence is in effect.
+.Pp
Although PPP is a binary protocol, it has the ability to avoid using characters
-that interfere with serial operation. The default alternate break sequence is
-CTRL-m \fB~\fR CTRL-b, or \fB0D 7E 02\fR in hexadecimal. In PPP, this can be
-avoided by setting either \fB0x00000004\fR or \fB0x00002000\fR in the ACCM.
+that interfere with serial operation.
+The default alternate break sequence is
+CTRL-m
+.Sy ~
+CTRL-b, or
+.Sy 0D 7E 02
+in hexadecimal.
+In PPP, this can be avoided by setting either
+.Sy 0x00000004
+or
+.Sy 0x00002000
+in the ACCM.
This forces an escape for the CTRL-b or CTRL-m characters, respectively.
-.sp
-.LP
+.Pp
To do this in Solaris PPP 4.0, add:
-.sp
-.in +2
-.nf
-asyncmap 0x00002000
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-to the \fB/etc/ppp/options\fR file or any of the other configuration files used
-for the connection. See \fBpppd\fR(1M).
-.sp
-.LP
+.Pp
+.Dl asyncmap 0x00002000
+.Pp
+to the
+.Pa /etc/ppp/options
+file or any of the other configuration files used for the connection.
+See
+.Xr pppd 1M .
+.Pp
SLIP has no comparable capability, and must not be used if the Alternate Break
sequence is in use.
-.sp
-.LP
-The Alternate Break sequence has no effect on the keyboard abort. For more
-information on the Alternate Break sequence, see \fBzs\fR(7D), \fBse\fR(7D),
-and \fBasy\fR(7D).
-.sp
-.LP
+.Pp
+The Alternate Break sequence has no effect on the keyboard abort.
+For more information on the Alternate Break sequence, see
+.Xr zs 7D ,
+.Xr se 7D ,
+and
+.Xr asy 7D .
+.Pp
On many systems, the default effect of the keyboard abort sequence is to
-suspend the operating system and enter the debugger or the monitor. Some
-systems feature key switches with a \fBsecure\fR position. On these systems,
-setting the key switch to the \fBsecure\fR position overrides any software
-default set with this command.
-.sp
-.LP
-To permanently change the software default effect of the keyboard abort
-sequence, first add or change the value of the \fBKEYBOARD_ABORT\fR variable in
-the \fB/etc/default/kbd\fR file to:
-.sp
-.in +2
-.nf
-KEYBOARD_ABORT=disable
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-Next, run the command \fBkbd\fR \fB-i\fR to change the setting. Valid settings
-are \fBenable\fR, \fBdisable\fR, and \fBalternate\fR; all other values are
-ignored. If the variable is not specified in the default file, the setting is
-unchanged.
-.sp
-.LP
-To set the abort sequence to the hardware BREAK, set the value of the
-\fBKEYBOARD_ABORT\fR variable in the \fB/etc/default/kbd\fR file to:
-.sp
-.in +2
-.nf
-KEYBOARD_ABORT=enable
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-To change the current setting, run the command \fBkbd\fR \fB-i\fR. To set the
-abort sequence to the Alternate Break character sequence, first set the current
-value of the \fBKEYBOARD_ABORT\fR variable in the \fB/etc/default/kbd\fR file
-to:
-.sp
-.in +2
-.nf
-KEYBOARD_ABORT=alternate
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-Next, run the command \fBkbd\fR \fB-i\fR to change the setting. When the
-Alternate Break sequence is in effect, only serial console devices are
-affected.
-.sp
-.LP
-To set the autorepeat delay by default, set the \fBREPEAT_DELAY\fR variable in
-the file \fB/etc/default/kbd\fR to the expected value with units in
-milliseconds (ms). To avoid making the keyboard unusable due to a typographical
-error, delay values below \fBKIOCRPTDELAY_MIN\fR (defined in
-\fB/usr/include/sys/kbio.h\fR) are rejected with \fBEINVAL\fR:
-.sp
-.in +2
-.nf
-REPEAT_DELAY=500
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-To set the autorepeat rate by default, set the \fBREPEAT_RATE\fR variable in
-the file \fB/etc/default/kbd\fR to the expected value with units in
-milliseconds. Negative and zero repeat rates are ejected with \fBEINVAL\fR:
-.sp
-.in +2
-.nf
-REPEAT_RATE=33
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-To change the current settings of \fIdelay\fR and \fIrate\fR, run the command,
-\fBkbd\fR \fB-i\fR. When the Auto Repeat Delay and/or Auto Repeat Rate are in
-effect, only command line mode is affected.
-.sp
-.LP
-To set the language by default, set the \fBLAYOUT\fR variable in the file
-\fB/etc/default/kbd\fR to the expected language. These languages supported in
-kernel can be found by running \fBkbd\fR \fB-s\fR. Other values are ignored.
-For example, the following sets Spanish layout to the keyboard:
-.sp
-.in +2
-.nf
-LAYOUT=Spanish
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-Next, run the \fBkbd\fR \fB-i\fR to change the setting. When Solaris reboots,
-the Spanish key table is loaded into the kernel. These layouts are valid for
-\fBusb\fR and \fBps/2\fR keyboards.
-.sp
-.LP
-To set the keyboard beeper frequency by default, set the \fBKBD_BEEPER_FREQ\fR
-variable in the file \fB/etc/default/kbd\fR to the expected value with units in
-HZ. This value should be between 0 and 32767, inclusive. Otherwise will be
-rejected with \fBEINVAL\fR:
-.sp
-.in +2
-.nf
-KBD_BEEPER_FREQ=2000
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-To set the console beeper frequency by default, set the
-\fBCONSOLE_BEEPER_FREQ\fR variable in the file \fB/etc/default/kbd\fR to the
-expected value with units in HZ. This value should be between 0 and 32767,
-inclusive. Otherwise will be rejected with \fBEINVAL\fR:
-.sp
-.in +2
-.nf
-CONSOLE_BEEPER_FREQ=900
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-To change the current settings of keyboard beeper frequency and console beeper
-frequency, run \fBkbd\fR \fB-i\fR.
-.SH OPTIONS
-.LP
-The following options are supported:
-.sp
-.ne 2
-.na
-\fB\fB-a\fR \fBenable\fR | \fBdisable\fR | \fBalternate\fR\fR
-.ad
-.sp .6
-.RS 4n
-Enables, disables, or alternates the keyboard abort sequence effect. By
-default, a keyboard abort sequence suspends the operating system on most
-systems. This sequence is typically Stop-A or L1-A and Shift-Pause on the
-keyboard on \fBSPARC\fR systems, F1-A and Shift-Pause on x86 systems, and BREAK
+suspend the operating system and enter the debugger or the monitor.
+Some systems feature key switches with a
+.Sy secure
+position.
+On these systems, setting the key switch to the
+.Sy secure
+position overrides any software default set with this command.
+.Sh OPTIONS
+The following options are suported:
+.Bl -hang
+.It Fl a Ar enable | Ar disable | Ar alternate
+.Pp
+Enables, disables, or alternates the keyboard abort sequence effect.
+By default, a keyboard abort sequence suspends the operating system on most
+systems.
+This sequence is typically
+.Sy Stop-A
+or
+.Sy L1-A
+and
+.Sy Shift-Pause
+on the keyboard on
+.Sy SPARC
+systems,
+.Sy F1-A
+and
+.Sy Shift-Pause
+on x86 systems, and
+.Sy BREAK
on the serial console device.
-.sp
-The default keyboard behavior can be changed using this option. The \fB-a\fR
+.Pp
+The default keyboard behavior can be changed using this option.
+The
+.Fl a
option can only be used by a super-user.
-.sp
-.ne 2
-.na
-\fB\fBenable\fR\fR
-.ad
-.RS 13n
+.Bl -hang
+.It Ar enable
Enables the default effect of the keyboard abort sequence (suspend the
operating system and enter the debugger or the monitor).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBdisable\fR\fR
-.ad
-.RS 13n
+.It Ar disable
Disables the default/alternate effect and ignores keyboard abort sequences.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBalternate\fR\fR
-.ad
-.RS 13n
+.It Ar alternate
Enables the alternate effect of the keyboard abort sequences (suspend the
operating system and enter the debugger or the monitor) upon receiving the
-Alternate Break character sequence on the console. The Alternate Break sequence
-is defined by the drivers \fBzs\fR(7D), \fBse\fR(7D), \fBasy\fR(7D). Due to a
-risk of incorrect sequence interpretation, binary protocols cannot be run over
-the serial console port when this value is used.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-b\fR \fBkeyboard\fR | \fBconsole\fR\fR
-.ad
-.sp .6
-.RS 4n
+Alternate Break character sequence on the console.
+The Alternate Break sequence is defined by the drivers
+.Xr asy 7D ,
+.Xr se 7D ,
+.Xr zs 7D .
+Due to a risk of incorrect sequence interpretation, binary protocols cannot be
+run over the serial console port when this value is used.
+.El
+.It Fl A Ar count
+.Pp
+Sets autorepeat count.
+Value
+.Sy -1
+denotes unlimited autorepeat (default).
+.It Fl b Ar keyboard | Ar console
+.Pp
Sets the beeper frequency for keyboard or console.
-.sp
-.ne 2
-.na
-\fB\fBkeyboard\fR\fR
-.ad
-.RS 12n
-Set the keyboard beeper frequency to the operand in HZ. See \fBOPERANDS\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBconsole\fR\fR
-.ad
-.RS 12n
-Sets the console beeper frequency to the operand in HZ. See \fBOPERANDS\fR.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-c\fR \fBon\fR | \fBoff\fR\fR
-.ad
-.sp .6
-.RS 4n
+.Bl -hang
+.It Ar keyboard
+Set the keyboard beeper frequency to the operand in HZ.
+See
+.Sx OPERANDS .
+.It Ar console
+Sets the console beeper frequency to the operand in HZ.
+See
+.Sx OPERANDS .
+.El
+.It Fl c Ar on | Ar off
+.Pp
Turns the clicking of the keyboard on or off.
-.sp
-.ne 2
-.na
-\fB\fBon\fR\fR
-.ad
-.RS 7n
+.Bl -hang
+.It Ar on
Enables clicking
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBoff\fR\fR
-.ad
-.RS 7n
+.It Ar off
Disables clicking
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-d\fR \fIkeyboard device\fR\fR
-.ad
-.sp .6
-.RS 4n
-Specifies the keyboard device being set. The default setting is \fB/dev/kbd\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-D\fR \fIautorepeat delay\fR\fR
-.ad
-.sp .6
-.RS 4n
+.El
+.It Fl d Ar keyboard device
+.Pp
+Specifies the keyboard device being set.
+The default setting is
+.Pa /dev/kbd .
+.It Fl D Ar autorepeat delay
+.Pp
Sets the autorepeat delay in milliseconds.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-i\fR\fR
-.ad
-.sp .6
-.RS 4n
-Sets keyboard properties from the keyboard default file. With the exception of
-\fB-d\fR \fIkeyboard device\fR, this option cannot be used with any other
-option. The \fB-i\fR option instructs the keyboard command to read and process
-keyclick and keyboard abort default values from the \fB/etc/default/kbd\fR
-file. The \fB-i\fR option can only be used by a user or role with the Device
-Security Rights Profile.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-l\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Fl i
+.Pp
+Sets keyboard properties from the keyboard default file.
+With the exception of
+.Fl d Ar keyboard device ,
+this option cannot be used with any other option.
+The
+.Fl i
+option instructs the keyboard command to read and process
+keyclick and keyboard abort default values from the keyboard configuration
+service,
+.Sy svc:/system/keymap:default .
+The
+.Fl i
+option can only be used by a user or role with the
+.Sy Device Security Rights Profile .
+.It Fl l
+.Pp
Returns the layout code of the keyboard being used, and the autorepeat delay
and autorepeat rate being used.
-.sp
-If used with -R or -D option, this option returns the value before the changes.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-r\fR\fR
-.ad
-.sp .6
-.RS 4n
+.Pp
+If used with
+.Fl R
+or
+.Fl D
+option, this option returns the value before the changes.
+.It Fl r
Resets the keyboard as if power-up.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-R\fR \fIautorepeat rate\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Fl R Ar autorepeat rate
+.Pp
Sets the autorepeat rate in milliseconds.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB\fR\fB-s\fR \fB[\fR\fIlanguage\fR\fB]\fR\fR
-.ad
-.sp .6
-.RS 4n
+.It Fl s Op Ar language
+.Pp
Sets the keyboard layout into the kernel.
-.sp
-If \fIlanguage\fR is specified, the layout is set to \fIlanguage\fR, and
-\fBloadkeys\fR(1) runs implicitly. If \fIlanguage\fR is not specified, a list
-of available layouts are presented, prompting for the user to specify the
-\fIlanguage\fR. See \fBOPERANDS\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-t\fR\fR
-.ad
-.sp .6
-.RS 4n
+.Pp
+If
+.Ar language
+is specified, the layout is set to
+.Ar language ,
+and
+.Xr loadkeys 1
+runs implicitly.
+If
+.Ar language
+is not specified, a list of available layouts are presented, prompting for the
+user to specify the
+.Ar language .
+See
+.Sx OPERANDS .
+.It Fl t
+.Pp
Returns the type of the keyboard being used.
-.RE
-
-.SH OPERANDS
-.LP
+.El
+.Sh OPERANDS
The following operands are supported:
-.sp
-.ne 2
-.na
-\fBfrequency\fR
-.ad
-.RS 13n
-The frequency value specified to be set in kernel. The receiver of this value
-is specified by the \fB-b\fR option. This value should be between 0 and 32767
-otherwise will be ejected with \fBEINVAL\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBlanguage\fR
-.ad
-.RS 13n
-The language specified to be set in kernel. If the language is not found, the
-languages supported are listed for selection. It only applies to \fB-s\fR
+.Bl -hang
+.It Ar frequency
+The frequency value specified to be set in kernel.
+The receiver of this value is specified by the
+.Fl b
option.
-.RE
-
-.SH EXAMPLES
-.LP
-\fBExample 1 \fRDisplaying the Keyboard Type
-.sp
-.LP
+This value should be between 0 and 32767 otherwise will be ejected with
+.Sy EINVAL .
+.It Ar language
+The language specified to be set in kernel.
+If the language is not found, the languages supported are listed for selection.
+It only applies to
+.Fl s
+option.
+.El
+.Sh FILES
+.Bl -ohang
+.It Pa /dev/kbd
+Keyboard device file.
+.El
+.Sh EXAMPLES
+.Bl -ohang
+.It Sy Example 1 Displaying the Keyboard Type
+.Pp
The following example displays the keyboard type:
-
-.sp
-.in +2
-.nf
-example% kbd -t
-Type 4 Sun keyboard
-example%
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 2 \fRSetting Keyboard Defaults
-.sp
-.LP
+.Pp
+.Dl example% kbd -t
+.Dl Type 4 Sun keyboard
+.Dl example%
+.El
+.Bl -ohang
+.It Sy Example 2 Setting Keyboard Defaults
+.Pp
The following example sets the keyboard defaults as specified in the keyboard
default file:
-
-.sp
-.in +2
-.nf
-example# kbd -i
-example#
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 3 \fRDisplaying Information
-.sp
-.LP
-The following example displays keyboard type and layout code. It also displays
-auto repeat delay and rate settings.
-
-.sp
-.in +2
-.nf
-example% kbd -l
-type=4
-layout=43 (0x2b)
-delay(ms)=500
-rate(ms)=33
-example%
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 4 \fRSetting Keyboard Autorepeat Delay
-.sp
-.LP
+.Pp
+.Dl example# kbd -i
+.Dl example#
+.El
+.Bl -ohang
+.It Sy Example 3 Displaying Information
+.Pp
+The following example displays keyboard type and layout code.
+It also displays auto repeat delay, rate and count settings.
+.Pp
+.Dl example% kbd -l
+.Dl type=6
+.Dl layout=274 (0x112)
+.Dl delay(ms)=500
+.Dl rate(ms)=40
+.Dl count=unlimited
+.Dl example%
+.El
+.Bl -ohang
+.It Sy Example 4 Setting Keyboard Autorepeat Delay
+.Pp
The following example sets the keyboard autorepeat delay:
-
-.sp
-.in +2
-.nf
-example% kbd -D 300
-example%
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 5 \fRSetting Keyboard Autorepeat Rate
-.sp
-.LP
+.Pp
+.Dl example% kbd -D 300
+.Dl example%
+.El
+.Bl -ohang
+.It Sy Example 5 Setting Keyboard Autorepeat Rate
+.Pp
The following example sets the keyboard autorepeat rate:
-
-.sp
-.in +2
-.nf
-example% kbd -R 50
-example%
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 6 \fRSelecting and Setting the Keyboard Language
-.sp
-.LP
+.Pp
+.Dl example% kbd -R 50
+.Dl example%
+.El
+.Bl -ohang
+.It Sy Example 6 Selecting and Setting the Keyboard Language
+.Pp
The following example selects and sets the keyboard language from a list of
languages specified:
-
-.sp
-.in +2
-.nf
+.Pp
+.Bd -literal -offset indent -compact
example% kbd -s
1. Albanian 16. Malta_UK
2. Belarusian 17. Malta_US
@@ -576,91 +343,66 @@ example% kbd -s
To select the keyboard layout, enter a number [default n]:
example%
-.fi
-.in -2
-.sp
-
-.sp
-.LP
+.Ed
+.Pp
The following example sets the keyboard language specified:
-
-.sp
-.in +2
-.nf
-example% kbd -s Dutch
-example%
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 7 \fRSetting the Keyboard Beeper Frequency
-.sp
-.LP
+.Pp
+.Dl example% kbd -s Dutch
+.Dl example%
+.El
+.Bl -ohang
+.It Sy Example 7 Setting the Keyboard Beeper Frequency
+.Pp
The following example sets the keyboard beeper frequency:
-
-.sp
-.in +2
-.nf
-example% kbd -b keyboard 1000
-example%
-.fi
-.in -2
-.sp
-
-.SH FILES
-.ne 2
-.na
-\fB\fB/dev/kbd\fR\fR
-.ad
-.RS 20n
-Keyboard device file.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/etc/default/kbd\fR\fR
-.ad
-.RS 20n
-Keyboard default file containing software defaults for keyboard configurations.
-.RE
-
-.SH SEE ALSO
-.LP
-\fBloadkeys\fR(1), \fBsvcs\fR(1), \fBinetd\fR(1M), \fBinetadm\fR(1M),
-\fBkadb\fR(1M), \fBsvcadm\fR(1M), \fBpppd\fR(1M), \fBkeytables\fR(4),
-\fBattributes\fR(5), \fBsmf\fR(5), \fBkb\fR(7M), \fBzs\fR(7D), \fBse\fR(7D),
-\fBasy\fR(7D), \fBvirtualkm\fR(7D)
-.SH NOTES
-.LP
-Some server systems have key switches with a \fBsecure\fR key position that can
-be read by system software. This key position overrides the normal default of
-the keyboard abort sequence effect and changes the default so the effect is
-disabled. When the key switch is in the \fBsecure\fR position on these systems,
-the keyboard abort sequence effect cannot be overridden by the software
-default, which is settable with the \fBkbd\fR utility.
-.sp
-.LP
+.Pp
+.Dl example% kbd -b keyboard 1000
+.Dl example%
+.El
+.Sh SEE ALSO
+.Xr loadkeys 1 ,
+.Xr svcs 1 ,
+.Xr kadb 1M ,
+.Xr pppd 1M ,
+.Xr svcadm 1M ,
+.Xr keytables 4 ,
+.Xr attributes 5 ,
+.Xr smf 5 ,
+.Xr asy 7D ,
+.Xr se 7D ,
+.Xr virtualkm 7D ,
+.Xr zs 7D ,
+.Xr kb 7M
+.Sh NOTES
+Some server systems have key switches with a
+.Sy secure
+key position that can be read by system software.
+This key position overrides the normal default of the keyboard abort sequence
+effect and changes the default so the effect is disabled.
+When the key switch is in the
+.Sy secure
+position on these systems, the keyboard abort sequence effect cannot be
+overridden by the software default, which is settable with the
+.Nm
+utility.
+.Pp
Currently, there is no way to determine the state of the keyboard click
setting.
-.sp
-.LP
-The \fBkdb\fR service is managed by the service management facility,
-\fBsmf\fR(5), under the service identifier:
-.sp
-.in +2
-.nf
-svc:/system/keymap:default
-.fi
-.in -2
-.sp
-
-.sp
-.LP
+.Pp
+The
+.Nm
+service is managed by the service management facility,
+.Xr smf 5 ,
+under the service identifier:
+.Pp
+.Dl svc:/system/keymap:default
+.Pp
Administrative actions on this service, such as enabling, disabling, or
-requesting restart, can be performed using \fBsvcadm\fR(1M). Responsibility for
-initiating and restarting this service is delegated to \fBinetd\fR(1M). Use
-\fBinetadm\fR(1M) to make configuration changes and to view configuration
-information for this service. The service's status can be queried using the
-\fBsvcs\fR(1) command.
+requesting restart, can be performed using
+.Xr svcadm 1M .
+Use
+.Xr svccfg 1M
+to make configuration changes and to view configuration information for this
+service.
+The service's status can be queried using the
+.Xr svcs 1
+command.
diff --git a/usr/src/uts/common/io/kbtrans/kbtrans_streams.c b/usr/src/uts/common/io/kbtrans/kbtrans_streams.c
index d56b92954c..170eef268e 100644
--- a/usr/src/uts/common/io/kbtrans/kbtrans_streams.c
+++ b/usr/src/uts/common/io/kbtrans/kbtrans_streams.c
@@ -995,6 +995,43 @@ kbtrans_ioctl(struct kbtrans *upper, register mblk_t *mp)
*/
return (KBTRANS_MESSAGE_NOT_HANDLED);
+ case KIOCGRPTCOUNT:
+ /*
+ * Report the autorepeat count
+ */
+ DPRINTF(PRINT_L0, PRINT_MASK_ALL, (upper, "KIOCGRPTCOUNT\n"));
+ if ((datap = allocb(sizeof (int), BPRI_HI)) == NULL) {
+ ioctlrespsize = sizeof (int);
+ goto allocfailure;
+ }
+ *(int *)datap->b_wptr = kbtrans_repeat_count;
+ datap->b_wptr += sizeof (int);
+
+ /* free msg to prevent memory leak */
+ if (mp->b_cont != NULL)
+ freemsg(mp->b_cont);
+ mp->b_cont = datap;
+ iocp->ioc_count = sizeof (int);
+ break;
+
+ case KIOCSRPTCOUNT:
+ /*
+ * Set the autorepeat count
+ */
+ DPRINTF(PRINT_L0, PRINT_MASK_ALL, (upper, "KIOCSRPTCOUNT\n"));
+ err = miocpullup(mp, sizeof (int));
+
+ if (err != 0)
+ break;
+
+ /* validate the input */
+ if (*(int *)mp->b_cont->b_rptr < -1) {
+ err = EINVAL;
+ break;
+ }
+ kbtrans_repeat_count = (*(int *)mp->b_cont->b_rptr);
+ break;
+
case KIOCGRPTDELAY:
/*
* Report the autorepeat delay, unit in millisecond
diff --git a/usr/src/uts/common/os/streamio.c b/usr/src/uts/common/os/streamio.c
index d4c2f7023d..0f6077915f 100644
--- a/usr/src/uts/common/os/streamio.c
+++ b/usr/src/uts/common/os/streamio.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
@@ -3419,6 +3419,7 @@ strioctl(struct vnode *vp, int cmd, intptr_t arg, int flag, int copyflag,
case KIOCSDIRECT:
case KIOCSCOMPAT:
case KIOCSKABORTEN:
+ case KIOCSRPTCOUNT:
case KIOCSRPTDELAY:
case KIOCSRPTRATE:
case VUIDSFORMAT:
@@ -3488,6 +3489,7 @@ strioctl(struct vnode *vp, int cmd, intptr_t arg, int flag, int copyflag,
case TCGETS:
case LDGETT:
case TIOCGETP:
+ case KIOCGRPTCOUNT:
case KIOCGRPTDELAY:
case KIOCGRPTRATE:
strioc.ic_len = 0;
@@ -5422,7 +5424,7 @@ strioctl(struct vnode *vp, int cmd, intptr_t arg, int flag, int copyflag,
/*
* Set/clear the write options. arg is a bit
* mask with any of the following bits set...
- * SNDZERO - send zero length message
+ * SNDZERO - send zero length message
* SNDPIPE - send sigpipe to process if
* sd_werror is set and process is
* doing a write or putmsg.
@@ -5883,7 +5885,7 @@ out:
* ic_timout is not INFTIM). Non-stream head errors may be returned if
* the ioc_error indicates that the driver/module had problems,
* an EFAULT was found when accessing user data, a lack of
- * resources, etc.
+ * resources, etc.
*/
int
strdoioctl(
diff --git a/usr/src/uts/common/sys/kbio.h b/usr/src/uts/common/sys/kbio.h
index 294710c002..b2fa36c46f 100644
--- a/usr/src/uts/common/sys/kbio.h
+++ b/usr/src/uts/common/sys/kbio.h
@@ -49,14 +49,14 @@ extern "C" {
*/
#define KIOCTRANS (KIOC|30) /* set keyboard translation */
#define KIOCGTRANS (KIOC|35) /* get keyboard translation */
-#define KIOCTRANSABLE (KIOC|36) /* set keyboard translatability */
+#define KIOCTRANSABLE (KIOC|36) /* set keyboard translatability */
#define KIOCGTRANSABLE (KIOC|37) /* get keyboard translatability */
#else /* __i386 || __i386_COMPAT */
#define KIOCTRANS (KIOC|0) /* set keyboard translation */
#define KIOCGTRANS (KIOC|5) /* get keyboard translation */
-#define KIOCTRANSABLE (KIOC|6) /* set keyboard translatability */
+#define KIOCTRANSABLE (KIOC|6) /* set keyboard translatability */
#define KIOCGTRANSABLE (KIOC|7) /* get keyboard translatability */
#endif /* __i386 || __i386_COMPAT */
@@ -237,6 +237,12 @@ struct freq_request {
#define KIOCRPTDELAY_MIN (100)
#define KIOCRPTRATE_MIN (1)
+/*
+ * Get/Set Keyboard autorepeat count.
+ */
+#define KIOCGRPTCOUNT (KIOC|28)
+#define KIOCSRPTCOUNT (KIOC|29)
+
#ifdef __cplusplus
}
#endif