LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 09-19-2023, 02:25 AM   #1
Hinara
LQ Newbie
 
Registered: Sep 2023
Posts: 1

Rep: Reputation: 0
Ask for review - Kernel driver for GameCube Controller adapter + Udev rule priority


Hi,

It's my first time on this forum.
I made my first kernel driver for the GameCube Controller adapter of Nintendo
I would like to know if some people who work regularly with kernel modules have a few tips to improve my code or maybe some mistake I made, it might contains some race condition.

Also does someone know if it is possible to prioritize my module to usbhid (if possible without udev rules)?
because it force me to unbind the controller from usbhid and rebind it on my driver each time I plug my adapter
Apparently it is because I made an USB driver which is considered less specilized than usbhid
However the controller does not really support correctly the usbhid interface, or the usbhid is missing something has lsusb say that there is no descriptor report

Code:
Bus 001 Device 009: ID 057e:0337 Nintendo Co., Ltd Wii U GameCube Controller Adapter
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x057e Nintendo Co., Ltd
  idProduct          0x0337 Wii U GameCube Controller Adapter
  bcdDevice            1.00
  iManufacturer           1 Nintendo
  iProduct                2 WUP-028
  iSerial                 3 15/07/2014
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0029
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     214
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0025  1x 37 bytes
        bInterval               8
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0005  1x 5 bytes
        bInterval               8
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0003
  Self Powered
  Remote Wakeup Enabled

Code repository:
https://github.com/Hinara/gamecube-adapter

Source used to develop it:
https://github.com/ToadKing/wii-u-gc-adapter
Dolphin
Linux Kernel source code especially xpad.c

Last edited by Hinara; 09-19-2023 at 02:40 AM. Reason: Addding information
 
  


Reply



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
Udev rule for ATA raid Controller nogetfx Debian 6 07-12-2007 04:05 PM
gamecube and linux GCNnut Linux - Newbie 4 09-26-2005 09:32 AM
Great application for the GameCube edwardedd Linux - Games 3 07-25-2005 01:29 PM
Best Emulator, PS2,xbox, GameCube... ctux Linux - Games 1 08-15-2004 10:05 AM
Linux for GameCube? Darwin Linux - General 7 10-02-2003 10:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 02:46 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