mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <WHarms@bfs.de> (Walter Harms)
To: <linux-kernel@vger.kernel.org>
Subject: fix for broken pc_keyb.c (late 2.2.x all 2.4.x kernel)
Date: Sat, 27 Oct 2001 16:09:51 +0100	[thread overview]
Message-ID: <vines.sxdD+zsgqvA@SZKOM.BFS.DE> (raw)



hi list,
there is a logical problem with pc_keyb.c. if setting the leds does not work the keyboard will no longer exists.
attention:  
pckbd_leds() is also know as kbd_leds() what is used quit often !

This is a quick fix ! (read: no real solution !)

some comments from my side:

1. the kbd_exists stuff is not realy documented. I should be removed or explaind properly.

2. the next better way is to check for the returncode from
send_data() and send kbd_exists accordingly.

3. kdb_rate works the same way but does not set kbd_exists


	walter











*** pc_keyb.c   Sat Oct 27 15:57:20 2001
--- pc_keyb.c.broken    Sat Oct 27 15:46:45 2001
***************
*** 525,543 ****
        return 0;
  }
  
- 
- /* someone added kbd_exists i dont know when or why    */
- /* but there a few routines that ever check kdb_exists */
- /* if somebody understands it *please* document        */ 
- /* The old code liked to shut down my keyboad          */
- /* the routine is also known as kbd_leds()           */ 
- /* walter.harms@informatik.uni-oldenburg.de            */
- 
  void pckbd_leds(unsigned char leds)
  {
        if (kbd_exists && (!send_data(KBD_CMD_SET_LEDS) || !send_data(leds))) {
                send_data(KBD_CMD_ENABLE);      /* re-enable kbd if any errors */
!               kbd_exists = 1;
        }
  }
  
--- 525,535 ----
        return 0;
  }
  
  void pckbd_leds(unsigned char leds)
  {
        if (kbd_exists && (!send_data(KBD_CMD_SET_LEDS) || !send_data(leds))) {
                send_data(KBD_CMD_ENABLE);      /* re-enable kbd if any errors */
!               kbd_exists = 0;
        }
  }



                 reply	other threads:[~2001-10-27 14:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vines.sxdD+zsgqvA@SZKOM.BFS.DE \
    --to=wharms@bfs.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®