mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-03 12:35:02 +00:00
style(9) changes before I do more real changes.
This commit is contained in:
parent
32dd3b4a7a
commit
f0143dac9a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=245314
@ -401,7 +401,7 @@ atkbd_init(int unit, keyboard_t **kbdp, void *arg, int flags)
|
|||||||
bcopy(&key_map, keymap, sizeof(key_map));
|
bcopy(&key_map, keymap, sizeof(key_map));
|
||||||
bcopy(&accent_map, accmap, sizeof(accent_map));
|
bcopy(&accent_map, accmap, sizeof(accent_map));
|
||||||
bcopy(fkey_tab, fkeymap,
|
bcopy(fkey_tab, fkeymap,
|
||||||
imin(fkeymap_size*sizeof(fkeymap[0]), sizeof(fkey_tab)));
|
imin(fkeymap_size * sizeof(fkeymap[0]), sizeof(fkey_tab)));
|
||||||
kbd_set_maps(kbd, keymap, accmap, fkeymap, fkeymap_size);
|
kbd_set_maps(kbd, keymap, accmap, fkeymap, fkeymap_size);
|
||||||
kbd->kb_data = (void *)state;
|
kbd->kb_data = (void *)state;
|
||||||
|
|
||||||
@ -424,8 +424,8 @@ atkbd_init(int unit, keyboard_t **kbdp, void *arg, int flags)
|
|||||||
if (!KBD_IS_INITIALIZED(kbd) && !(flags & KB_CONF_PROBE_ONLY)) {
|
if (!KBD_IS_INITIALIZED(kbd) && !(flags & KB_CONF_PROBE_ONLY)) {
|
||||||
kbd->kb_config = flags & ~KB_CONF_PROBE_ONLY;
|
kbd->kb_config = flags & ~KB_CONF_PROBE_ONLY;
|
||||||
if (KBD_HAS_DEVICE(kbd)
|
if (KBD_HAS_DEVICE(kbd)
|
||||||
&& init_keyboard(state->kbdc, &kbd->kb_type, kbd->kb_config)
|
&& init_keyboard(state->kbdc, &kbd->kb_type, kbd->kb_config)
|
||||||
&& (kbd->kb_config & KB_CONF_FAIL_IF_NO_KBD)) {
|
&& (kbd->kb_config & KB_CONF_FAIL_IF_NO_KBD)) {
|
||||||
kbd_unregister(kbd);
|
kbd_unregister(kbd);
|
||||||
error = ENXIO;
|
error = ENXIO;
|
||||||
goto bad;
|
goto bad;
|
||||||
@ -485,8 +485,7 @@ atkbd_intr(keyboard_t *kbd, void *arg)
|
|||||||
* The keyboard was not detected before;
|
* The keyboard was not detected before;
|
||||||
* it must have been reconnected!
|
* it must have been reconnected!
|
||||||
*/
|
*/
|
||||||
init_keyboard(state->kbdc, &kbd->kb_type,
|
init_keyboard(state->kbdc, &kbd->kb_type, kbd->kb_config);
|
||||||
kbd->kb_config);
|
|
||||||
KBD_FOUND_DEVICE(kbd);
|
KBD_FOUND_DEVICE(kbd);
|
||||||
atkbd_ioctl(kbd, KDSETLED, (caddr_t)&state->ks_state);
|
atkbd_ioctl(kbd, KDSETLED, (caddr_t)&state->ks_state);
|
||||||
get_typematic(kbd);
|
get_typematic(kbd);
|
||||||
@ -645,7 +644,7 @@ atkbd_read_char(keyboard_t *kbd, int wait)
|
|||||||
goto next_code;
|
goto next_code;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0xE0: /* 0xE0 prefix */
|
case 0xE0: /* 0xE0 prefix */
|
||||||
state->ks_prefix = 0;
|
state->ks_prefix = 0;
|
||||||
switch (keycode) {
|
switch (keycode) {
|
||||||
case 0x1C: /* right enter key */
|
case 0x1C: /* right enter key */
|
||||||
@ -655,57 +654,57 @@ atkbd_read_char(keyboard_t *kbd, int wait)
|
|||||||
keycode = 0x5A;
|
keycode = 0x5A;
|
||||||
break;
|
break;
|
||||||
case 0x35: /* keypad divide key */
|
case 0x35: /* keypad divide key */
|
||||||
keycode = 0x5B;
|
keycode = 0x5B;
|
||||||
break;
|
break;
|
||||||
case 0x37: /* print scrn key */
|
case 0x37: /* print scrn key */
|
||||||
keycode = 0x5C;
|
keycode = 0x5C;
|
||||||
break;
|
break;
|
||||||
case 0x38: /* right alt key (alt gr) */
|
case 0x38: /* right alt key (alt gr) */
|
||||||
keycode = 0x5D;
|
keycode = 0x5D;
|
||||||
break;
|
break;
|
||||||
case 0x46: /* ctrl-pause/break on AT 101 (see below) */
|
case 0x46: /* ctrl-pause/break on AT 101 (see below) */
|
||||||
keycode = 0x68;
|
keycode = 0x68;
|
||||||
break;
|
break;
|
||||||
case 0x47: /* grey home key */
|
case 0x47: /* grey home key */
|
||||||
keycode = 0x5E;
|
keycode = 0x5E;
|
||||||
break;
|
break;
|
||||||
case 0x48: /* grey up arrow key */
|
case 0x48: /* grey up arrow key */
|
||||||
keycode = 0x5F;
|
keycode = 0x5F;
|
||||||
break;
|
break;
|
||||||
case 0x49: /* grey page up key */
|
case 0x49: /* grey page up key */
|
||||||
keycode = 0x60;
|
keycode = 0x60;
|
||||||
break;
|
break;
|
||||||
case 0x4B: /* grey left arrow key */
|
case 0x4B: /* grey left arrow key */
|
||||||
keycode = 0x61;
|
keycode = 0x61;
|
||||||
break;
|
break;
|
||||||
case 0x4D: /* grey right arrow key */
|
case 0x4D: /* grey right arrow key */
|
||||||
keycode = 0x62;
|
keycode = 0x62;
|
||||||
break;
|
break;
|
||||||
case 0x4F: /* grey end key */
|
case 0x4F: /* grey end key */
|
||||||
keycode = 0x63;
|
keycode = 0x63;
|
||||||
break;
|
break;
|
||||||
case 0x50: /* grey down arrow key */
|
case 0x50: /* grey down arrow key */
|
||||||
keycode = 0x64;
|
keycode = 0x64;
|
||||||
break;
|
break;
|
||||||
case 0x51: /* grey page down key */
|
case 0x51: /* grey page down key */
|
||||||
keycode = 0x65;
|
keycode = 0x65;
|
||||||
break;
|
break;
|
||||||
case 0x52: /* grey insert key */
|
case 0x52: /* grey insert key */
|
||||||
keycode = 0x66;
|
keycode = 0x66;
|
||||||
break;
|
break;
|
||||||
case 0x53: /* grey delete key */
|
case 0x53: /* grey delete key */
|
||||||
keycode = 0x67;
|
keycode = 0x67;
|
||||||
break;
|
break;
|
||||||
/* the following 3 are only used on the MS "Natural" keyboard */
|
/* the following 3 are only used on the MS "Natural" keyboard */
|
||||||
case 0x5b: /* left Window key */
|
case 0x5b: /* left Window key */
|
||||||
keycode = 0x69;
|
keycode = 0x69;
|
||||||
break;
|
break;
|
||||||
case 0x5c: /* right Window key */
|
case 0x5c: /* right Window key */
|
||||||
keycode = 0x6a;
|
keycode = 0x6a;
|
||||||
break;
|
break;
|
||||||
case 0x5d: /* menu key */
|
case 0x5d: /* menu key */
|
||||||
keycode = 0x6b;
|
keycode = 0x6b;
|
||||||
break;
|
break;
|
||||||
case 0x5e: /* power key */
|
case 0x5e: /* power key */
|
||||||
keycode = 0x6d;
|
keycode = 0x6d;
|
||||||
break;
|
break;
|
||||||
@ -716,10 +715,10 @@ atkbd_read_char(keyboard_t *kbd, int wait)
|
|||||||
keycode = 0x6f;
|
keycode = 0x6f;
|
||||||
break;
|
break;
|
||||||
default: /* ignore everything else */
|
default: /* ignore everything else */
|
||||||
goto next_code;
|
goto next_code;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0xE1: /* 0xE1 prefix */
|
case 0xE1: /* 0xE1 prefix */
|
||||||
/*
|
/*
|
||||||
* The pause/break key on the 101 keyboard produces:
|
* The pause/break key on the 101 keyboard produces:
|
||||||
* E1-1D-45 E1-9D-C5
|
* E1-1D-45 E1-9D-C5
|
||||||
@ -728,10 +727,10 @@ atkbd_read_char(keyboard_t *kbd, int wait)
|
|||||||
*/
|
*/
|
||||||
state->ks_prefix = 0;
|
state->ks_prefix = 0;
|
||||||
if (keycode == 0x1D)
|
if (keycode == 0x1D)
|
||||||
state->ks_prefix = 0x1D;
|
state->ks_prefix = 0x1D;
|
||||||
goto next_code;
|
goto next_code;
|
||||||
/* NOT REACHED */
|
/* NOT REACHED */
|
||||||
case 0x1D: /* pause / break */
|
case 0x1D: /* pause / break */
|
||||||
state->ks_prefix = 0;
|
state->ks_prefix = 0;
|
||||||
if (keycode != 0x45)
|
if (keycode != 0x45)
|
||||||
goto next_code;
|
goto next_code;
|
||||||
@ -743,7 +742,7 @@ atkbd_read_char(keyboard_t *kbd, int wait)
|
|||||||
switch (keycode) {
|
switch (keycode) {
|
||||||
case 0x37: /* *(numpad)/print screen */
|
case 0x37: /* *(numpad)/print screen */
|
||||||
if (state->ks_flags & SHIFTS)
|
if (state->ks_flags & SHIFTS)
|
||||||
keycode = 0x5c; /* print screen */
|
keycode = 0x5c; /* print screen */
|
||||||
break;
|
break;
|
||||||
case 0x45: /* num lock/pause */
|
case 0x45: /* num lock/pause */
|
||||||
if (state->ks_flags & CTLS)
|
if (state->ks_flags & CTLS)
|
||||||
@ -1177,7 +1176,7 @@ get_kbd_echo(KBDC kbdc)
|
|||||||
*/
|
*/
|
||||||
return ENXIO;
|
return ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1275,7 +1274,7 @@ init_keyboard(KBDC kbdc, int *type, int flags)
|
|||||||
}
|
}
|
||||||
if (bootverbose)
|
if (bootverbose)
|
||||||
printf("atkbd: the current kbd controller command byte %04x\n",
|
printf("atkbd: the current kbd controller command byte %04x\n",
|
||||||
c);
|
c);
|
||||||
#if 0
|
#if 0
|
||||||
/* override the keyboard lock switch */
|
/* override the keyboard lock switch */
|
||||||
c |= KBD_OVERRIDE_KBD_LOCK;
|
c |= KBD_OVERRIDE_KBD_LOCK;
|
||||||
@ -1415,52 +1414,49 @@ init_keyboard(KBDC kbdc, int *type, int flags)
|
|||||||
static int
|
static int
|
||||||
write_kbd(KBDC kbdc, int command, int data)
|
write_kbd(KBDC kbdc, int command, int data)
|
||||||
{
|
{
|
||||||
int s;
|
int s;
|
||||||
|
|
||||||
/* prevent the timeout routine from polling the keyboard */
|
/* prevent the timeout routine from polling the keyboard */
|
||||||
if (!kbdc_lock(kbdc, TRUE))
|
if (!kbdc_lock(kbdc, TRUE))
|
||||||
return EBUSY;
|
return EBUSY;
|
||||||
|
|
||||||
/* disable the keyboard and mouse interrupt */
|
/* disable the keyboard and mouse interrupt */
|
||||||
s = spltty();
|
s = spltty();
|
||||||
#if 0
|
#if 0
|
||||||
c = get_controller_command_byte(kbdc);
|
c = get_controller_command_byte(kbdc);
|
||||||
if ((c == -1)
|
if ((c == -1)
|
||||||
|| !set_controller_command_byte(kbdc,
|
|| !set_controller_command_byte(kbdc,
|
||||||
kbdc_get_device_mask(kbdc),
|
kbdc_get_device_mask(kbdc),
|
||||||
KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT
|
KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT
|
||||||
| KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
|
| KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) {
|
||||||
/* CONTROLLER ERROR */
|
/* CONTROLLER ERROR */
|
||||||
kbdc_lock(kbdc, FALSE);
|
kbdc_lock(kbdc, FALSE);
|
||||||
|
splx(s);
|
||||||
|
return EIO;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Now that the keyboard controller is told not to generate
|
||||||
|
* the keyboard and mouse interrupts, call `splx()' to allow
|
||||||
|
* the other tty interrupts. The clock interrupt may also occur,
|
||||||
|
* but the timeout routine (`scrn_timer()') will be blocked
|
||||||
|
* by the lock flag set via `kbdc_lock()'
|
||||||
|
*/
|
||||||
splx(s);
|
splx(s);
|
||||||
return EIO;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Now that the keyboard controller is told not to generate
|
|
||||||
* the keyboard and mouse interrupts, call `splx()' to allow
|
|
||||||
* the other tty interrupts. The clock interrupt may also occur,
|
|
||||||
* but the timeout routine (`scrn_timer()') will be blocked
|
|
||||||
* by the lock flag set via `kbdc_lock()'
|
|
||||||
*/
|
|
||||||
splx(s);
|
|
||||||
#endif
|
#endif
|
||||||
|
if (send_kbd_command_and_data(kbdc, command, data) != KBD_ACK)
|
||||||
if (send_kbd_command_and_data(kbdc, command, data) != KBD_ACK)
|
send_kbd_command(kbdc, KBDC_ENABLE_KBD);
|
||||||
send_kbd_command(kbdc, KBDC_ENABLE_KBD);
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* restore the interrupts */
|
/* restore the interrupts */
|
||||||
if (!set_controller_command_byte(kbdc,
|
if (!set_controller_command_byte(kbdc, kbdc_get_device_mask(kbdc),
|
||||||
kbdc_get_device_mask(kbdc),
|
|
||||||
c & (KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS))) {
|
c & (KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS))) {
|
||||||
/* CONTROLLER ERROR */
|
/* CONTROLLER ERROR */
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
splx(s);
|
splx(s);
|
||||||
#endif
|
#endif
|
||||||
kbdc_lock(kbdc, FALSE);
|
kbdc_lock(kbdc, FALSE);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
Loading…
Reference in New Issue
Block a user