LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-18-2007, 11:37 PM   #1
bricedebrignaisplage
Member
 
Registered: Apr 2006
Location: singapore
Distribution: debian
Posts: 51

Rep: Reputation: 16
cannot locate handle_scancode in kernel


Hi

I am writing a kernel module to redirect the output of a barcode scanner to a file. The barcode scanner acts as keyboard. The way to do it is to replace the normal scancode handle by a custom one.
I am actually porting code from kernel 2.4 to kernel 2.6.

In the 2.4 version, I use this in the makefile in the compile command '-DHS_ADDRESS=0x$(word 1,$(shell ksyms -a | grep handle_scancode))'. This finds the address of the handle_scancode function within the kernel symbols.

The problem in 2.6 is that ksyms has disapeared. Moreover, if I do 'cat /proc/kallsyms | grep handle_scancode', it finds nothing. So I searched for handle_scancode in the kernel source code:
$> grep -nRH handle_scancode /usr/src/linux/*
/usr/src/linux/Documentation/input/input.txt:164:x86), and passes them into the handle_scancode function of the
/usr/src/linux/drivers/char/ec3104_keyb.c:221: handle_scancode(scancode, !(scancode & 0x80));
/usr/src/linux/drivers/char/qtronix.c:420: handle_scancode(scancode, down);
/usr/src/linux/drivers/char/scan_keyb.c:50: handle_scancode(*table, !(*new&bit));
/usr/src/linux/drivers/tc/lk201.c:363: handle_scancode(c, (shift_state & LK_LOCK) ? 1 : 0);
/usr/src/linux/drivers/tc/lk201.c:367: handle_scancode(c, (shift_state & LK_SHIFT) ? 1 : 0);
/usr/src/linux/drivers/tc/lk201.c:371: handle_scancode(c, (shift_state & LK_CTRL) ? 1 : 0);
/usr/src/linux/drivers/tc/lk201.c:375: handle_scancode(c, (shift_state & LK_COMP) ? 1 : 0);
/usr/src/linux/drivers/tc/lk201.c:379: handle_scancode(scancodeRemap[LK_KEY_SHIFT], 0);
/usr/src/linux/drivers/tc/lk201.c:381: handle_scancode(scancodeRemap[LK_KEY_CTRL], 0);
/usr/src/linux/drivers/tc/lk201.c:383: handle_scancode(scancodeRemap[LK_KEY_COMP], 0);
/usr/src/linux/drivers/tc/lk201.c:385: handle_scancode(scancodeRemap[LK_KEY_LOCK], 0);
/usr/src/linux/drivers/tc/lk201.c:389: handle_scancode(prev_scancode, 1);
/usr/src/linux/drivers/tc/lk201.c:393: handle_scancode(c, 1);

I find it very puzzling that it shows several references to handle_scancode but no definition.

So the question is: how can I find the address of that function? Or am I looking for the wrong function?

thanks


PS: I am using kernel 2.6.15, that I compiled myself (with a RTAI patch), under Ubuntu Dapper, on a x86 Toshiba laptop.
 
Old 04-25-2007, 04:44 AM   #2
bricedebrignaisplage
Member
 
Registered: Apr 2006
Location: singapore
Distribution: debian
Posts: 51

Original Poster
Rep: Reputation: 16
I found out that handle_scancode is defined in drivers/char/keyboard.c but in kernel 2.4.* only!
It seems that kernel 2.6.* uses some other function... How come it is still referenced by those files then? I posted on the kernel developpers newsgroup, but got no answer.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot locate kernel-module-ntfs for latest kernel -..2257- FC5 anilbh Fedora 2 12-22-2006 07:29 PM
cpan> locate -u Unknown shell command 'locate -u'. Type ? for help. sharad2005 Linux From Scratch 1 08-04-2006 12:40 AM
cannot find a kernel, please locate one bobotoes Linux - Newbie 2 10-07-2004 06:15 PM
my new kernel can't locate the sound card coldy Debian 5 11-23-2003 10:46 AM
New kernel wont locate the eth0 module concoran Linux - General 1 11-18-2001 01:10 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration