From: Reinhard N. <rn...@gm...> - 2002-05-20 10:52:16
|
Hi, attached you'll find a patch to adopt the implementation of kbdrate() for different archs (apus, amiga, atari, ...) to kernel 2.4.17. Below, you'll find the interesting part of a discussion with Geert Uytterhoeven about this issue, leading to the supplied patch. Geert asked me to send the patch to both mailing lists, as he is very busy at the moment and finds no time to integrate the patch into the kernel sources. So, would someone please be so kind and integrate it into the kernel sources. Thanks in advance. Bye. --- original discussion --- Hi, Geert Uytterhoeven wrote: > > On Tue, 26 Mar 2002, Reinhard Nissl wrote: > > Reinhard Nissl wrote: > > > I'm confused now, after doing some tests. > > > > > > The kbdrate binary from the distribution works with 2.2.10 und crashes with > > > 2.4.18 while accessing /dev/ports. > > > > I've investigated this further with strace. kbdrate does an ioctl() call. In > > 2.2.10, the call returns 0 and kbdrate exits. In 2.4.18, the call returns > > EINVAL and kbdrate tries to set the rate via /dev/ports, with fails on APUS. > > > > Looking at drivers/char/vt.c, I found that the ioctl() handler for KDKBDREP > > calls kbd_rate(). kbd_rate is a function pointer which initially points to > > _kbd_rate() and this is an empty implementation which simply returns EINVAL. > > > > Digging around further, I found a function amiga_kbdrate(), which has the same > > declaration as _kbd_rate(). There is also a function pointer mach_kbdrate that > > is similar to kbd_rate, and amiga_kbdrate gets assigned to it in > > arch/ppc/amiga/config.c. But I didn't find any location, that calls > > mach_kbdrate(). > > > > To make kbdrate work, I assume kbd_rate should be assigned the value of > > mach_kbdrate. (Where would an appropriate locaten be for this assignment?) > > > > A different solution would be, to drop mach_kbdrate and substitute it with > > kbd_rate. This would then be similar to kd_mksound. > > > > kd_mksound is also a function pointer, that is assigned a dummy implementation > > in drivers/char/vt.c. In arch/ppc/amiga/config.c, kd_mksound is overwritten > > with amiga_mksound. > > > > I would like to substitute mach_kbdrate with kdb_rate for all the archs that > > use it. What are your comments about doing so? > > I think the best solution is to kill mach_kbdrate and initialize _kbd_rate to > amiga_kbdrate in amiga_keyb_init(), cfr. pc_keyb.c. > > The same is true for atari_kbdrate, bvme6000_kbdrate, hp300_kbdrate, > mvme147_kbdrate, mvme16x_kbdrate, and sun3x_kbdrate. And dn_dummy_kbdrate() can > die as well. So I did. Attached you find a patch against current cvs kernel. I was only able to test the changes with APUS. Maybe you have access to a different arch. If the patch is ok, please forward it to someone that can integrate it into the kernel sources. Bye. -- Dipl.-Inform. (FH) Reinhard Nissl mailto:rn...@gm... |