Bug 268653 - /src/sys/dev/hyperv/input/hv_kbd.c error: use of undeclared identifier 'keycode'
Summary: /src/sys/dev/hyperv/input/hv_kbd.c error: use of undeclared identifier 'keycode'
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.1-STABLE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-virtualization (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-30 11:30 UTC by Sergey Samoyloff
Modified: 2024-01-27 18:49 UTC (History)
6 users (show)

See Also:


Attachments
GW and make output (23.07 KB, application/x-compressed)
2022-12-30 11:30 UTC, Sergey Samoyloff
no flags Details
GW extracted from the archive at comment 0 (15.51 KB, text/plain)
2022-12-30 13:21 UTC, Graham Perrin
no flags Details
GW.err extracted from the archive at comment 0 (155.10 KB, text/plain)
2022-12-30 13:21 UTC, Graham Perrin
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Samoyloff 2022-12-30 11:30:10 UTC
Created attachment 239130 [details]
GW and make output

stable13 git pull today,
make buildkernel KERNCONF=GW fail

recently everything was successful

GW and make output in attach
Comment 1 Graham Perrin freebsd_committer freebsd_triage 2022-12-30 13:21:04 UTC
Created attachment 239133 [details]
GW extracted from the archive at comment 0
Comment 2 Graham Perrin freebsd_committer freebsd_triage 2022-12-30 13:21:40 UTC
Created attachment 239134 [details]
GW.err extracted from the archive at comment 0
Comment 3 Johan Edbert 2023-01-02 06:44:52 UTC
still got same bug for me when git pull stable/13 today and make custom kernel
Comment 4 Marcos Pereira 2023-01-03 02:06:09 UTC
(In reply to Johan Edbert from comment #3)

Same with me using a virtual machine under hyper-v (with recent Windows 10 updates).

The error occurs both on a physical machine and on a virtual machine with "device hyperv" in the kernel configuration file.
Comment 5 Johan Edbert 2023-01-19 06:28:00 UTC
any update for this ? tried to pull again today but the error still exists.

--- hv_kbd.o ---
/usr/src/sys/dev/hyperv/input/hv_kbd.c:355:2: error: use of undeclared identifier 'keycode'
        keycode = scancode & 0x7F;
        ^
/usr/src/sys/dev/hyperv/input/hv_kbd.c:380:11: error: use of undeclared identifier 'keycode'
                switch (keycode) {
                        ^

--- hv_kbd.o ---
/usr/src/sys/dev/hyperv/input/hv_kbd.c:382:4: error: use of undeclared identifier 'keycode'
                        keycode = 0x59;
                        ^
/usr/src/sys/dev/hyperv/input/hv_kbd.c:385:4: error: use of undeclared identifier 'keycode'
                        keycode = 0x5A;
                        ^
/usr/src/sys/dev/hyperv/input/hv_kbd.c:388:4: error: use of undeclared identifier 'keycode'
                        keycode = 0x5B;
                        ^
/usr/src/sys/dev/hyperv/input/hv_kbd.c:391:4: error: use of undeclared identifier 'keycode'
                        keycode = 0x5C;
                        ^
/usr/src/sys/dev/hyperv/input/hv_kbd.c:394:4: error: use of undeclared identifier 'keycode'
                        keycode = 0x5D;
                        ^
/usr/src/sys/dev/hyperv/input/hv_kbd.c:397:4: error: use of undeclared identifier 'keycode'
                        keycode = 0x68;
                        ^
/usr/src/sys/dev/hyperv/input/hv_kbd.c:400:4: error: use of undeclared identifier 'keycode'
                        keycode = 0x5E;
                        ^
/usr/src/sys/dev/hyperv/input/hv_kbd.c:403:4: error: use of undeclared identifier 'keycode'
                        keycode = 0x5F;
                        ^
/usr/src/sys/dev/hyperv/input/hv_kbd.c:406:4: error: use of undeclared identifier 'keycode'
                        keycode = 0x60;
                        ^
/usr/src/sys/dev/hyperv/input/hv_kbd.c:409:4: error: use of undeclared identifier 'keycode'
                        keycode = 0x61;
                        ^
/usr/src/sys/dev/hyperv/input/hv_kbd.c:412:4: error: use of undeclared identifier 'keycode'
                        keycode = 0x62;
Comment 6 holmez 2023-02-01 22:22:19 UTC
(In reply to Marcos Pereira from comment #4)
I could confirm, bug exists since mid/late december 2022 AND seems to be connected to "device hyperv", without that option kernel build complete.
Comment 7 SimpleRezo 2023-06-12 14:57:07 UTC
This quick patch fix compilation:

/usr/src/sys/dev/hyperv/input$ diff -u hv_kbd.c.orig hv_kbd.c
--- hv_kbd.c.orig       2023-06-12 16:55:53.868095000 +0200
+++ hv_kbd.c    2023-06-12 16:47:27.604685000 +0200
@@ -269,9 +269,7 @@
        uint32_t action;
        keystroke ks;
        hv_kbd_sc *sc = kbd->kb_data;
-#ifdef EVDEV_SUPPORT
        int keycode;
-#endif
        HVKBD_LOCK_ASSERT();

        if (!KBD_IS_ACTIVE(kbd) || !hv_kbd_prod_is_ready(sc))
Comment 8 Joerg Wunsch freebsd_committer freebsd_triage 2024-01-14 16:54:40 UTC
(In reply to holmez from comment #6)
More precisely, hyperv enabled but no evdev enabled.

The #ifdev EVDEV_SUPPORT around the definition of "keycode" has already been removed in commit 55eb41bb1fb69429 by Vladimir Kondratyev on 2021-04-23. Seems he forgot to MFC that fix. I'm adding him to the Cc list.
Comment 9 commit-hook freebsd_committer freebsd_triage 2024-01-27 18:49:56 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=00a82bd964b68ad20f47b25f9419af14ff159f64

commit 00a82bd964b68ad20f47b25f9419af14ff159f64
Author:     Vladimir Kondratyev <wulf@FreeBSD.org>
AuthorDate: 2021-04-22 22:13:25 +0000
Commit:     Vladimir Kondratyev <wulf@FreeBSD.org>
CommitDate: 2024-01-27 18:46:46 +0000

    hv_kbd: Fix build with EVDEV_SUPPORT kernel option disabled.

    Reported by:    olivier
    PR:             268653

    (cherry picked from commit 55eb41bb1fb69429330ea415fb463735ae08da64)

 sys/dev/hyperv/input/hv_kbd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)