Documenting the IRIX USB Subsystem
#3
RE: Documenting the IRIX USB Subsystem
That's an achievement I tried to do with my kernel modules.

In fact the easiest part is to detect the PCI card. AFAIK, to detect new USB devices connect/unconnect/ is also very easy. We just read some PCI registers in the corresponding interfaceUHCI or EHCI depending on the device type we are connecting (Mouse, Keyboards and other low speedies will be taken by the UHCI controller. Hi speed devices will be taken by the EHCI controllers. The VIA8212 has 1 controller for UHCI and 2 for EHCI).

The funny part comes here: USB device enumeration, which we use to know which kind of device is connected, if it's a mouse, a keyboard, a game controller, or whatever, and with that, we get the device type. Fo this, once the new device is detected, we need to do some data exchange with the device. For this, we setup some data structures -a linked list- in the machine's DMA. The DMA chunk must be aligned to... 32k? don't remeber very well, all is in the UHCI/EHCI standard doc. In these linked lists, some data about the transfers is stored and of course, data from the devices are stored there by the UHCI/EHCI interface. If we accomplish this with the controllers UHCI/EHCI/xHCI, we are almost done with the hardest part of a decent USB stack and from here all will just go like a ride in the park.
bsdero
O2

Trade Count: (0)
Posts: 6
Threads: 2
Joined: Jul 2018
Find Reply
03-08-2021, 06:28 PM


Messages In This Thread
Documenting the IRIX USB Subsystem - by Raion - 02-25-2021, 05:58 PM
RE: Documenting the IRIX USB Subsystem - by mamed - 03-08-2021, 03:27 PM
RE: Documenting the IRIX USB Subsystem - by bsdero - 03-08-2021, 06:28 PM
RE: Documenting the IRIX USB Subsystem - by mamed - 03-17-2021, 03:27 PM
RE: Documenting the IRIX USB Subsystem - by Raion - 03-17-2021, 05:43 PM
RE: Documenting the IRIX USB Subsystem - by mamed - 03-18-2021, 05:13 PM
RE: Documenting the IRIX USB Subsystem - by bsdero - 03-21-2021, 07:08 PM
RE: Documenting the IRIX USB Subsystem - by mamed - 03-24-2021, 10:54 PM
RE: Documenting the IRIX USB Subsystem - by robespierre - 03-24-2021, 11:57 PM
RE: Documenting the IRIX USB Subsystem - by mamed - 03-27-2021, 08:07 PM
RE: Documenting the IRIX USB Subsystem - by Raion - 03-18-2021, 06:31 PM
RE: Documenting the IRIX USB Subsystem - by zizban - 08-06-2022, 06:34 PM
RE: Documenting the IRIX USB Subsystem - by Raion - 08-06-2022, 06:39 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)