Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-12-2012, 05:38 AM   #1
LQ Newbie
Registered: May 2012
Posts: 12

Rep: Reputation: Disabled
linux gadget hid driver insert error

Hi All

I am building the HID Composite Driver from the link below

The module build successfully but when i insert the module using insmod i got the following error:
insmod: error inserting './hid.ko': -1 Invalid parameters

Anyone have any idea about how to fix this issue?
Old 05-12-2012, 06:43 AM   #2
LQ Newbie
Registered: May 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
It seems that there are some issues in the build due to which invalid parameters error came up.

Now the invalid parameters error is gone but getting following error:
insmod: error inserting './g_hid.ko': -1 No such device

Anyone have any idea to solve this issue???
Old 05-12-2012, 10:22 AM   #3
LQ Newbie
Registered: May 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
Problem Solved.

step1: go to the link below.

step2: copy the following two structures from the above link and paste into hid.c

step3: compile the hid module

step4: load the module

That's it.
Old 09-03-2012, 09:17 PM   #4
LQ Newbie
Registered: Sep 2012
Posts: 1

Rep: Reputation: Disabled
hi Ma1,
your solution seems did not work for me.
I followed your steps, and it still failed with

"insmod: error inserting './g_hid.ko': -1 Invalid module format"

then, I found out the kernel that I am building is not the same version as the one I run the insmod command, so I rebuilt again.

but this time, I got

"insmod: error inserting './g_hid.ko': -1 No such device"

what could I be wrong? can you help?

also, both situations, I got message

"drivers/usb/gadget/hid.c:159:31: warning: ‘my_hid’ defined but not used [-Wunused-variable]"

from compiler, does this means the two structures added has not been used at all?


Last edited by damienwei; 09-04-2012 at 12:48 AM. Reason: not really fixed.


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
Linux usb gadget HID driver problem Sebteams69 Linux - Newbie 7 06-12-2012 02:24 PM
Using hid gadget for own purpose Ghal_Maraz Linux - Kernel 2 03-20-2012 10:42 AM
Insert HID messages into kernel? Aglets Linux - Kernel 1 09-14-2011 02:30 PM
LXer: Linux 3.1 Kernel Gains A Wiimote HID Driver LXer Syndicated Linux News 1 07-23-2011 01:33 PM
help on driver for USB HID device(finger print) in Linux malikamirshehzad Programming 1 02-18-2006 01:48 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:10 AM.

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