USB 1.1 UHCI improvements GSoC - Week 4

by VardanM | June 20, 2016

TO LEARN HOW TO SWIM, YOU NEED TO GET INTO THE WATER.

At the start of the week I was debugging the system crash on ROS's usbhub unload in Win2k3. I spent a lot of time asking questions and discussing topics related to WDM with my mentor Thfabba. He kind of kickstarted me, giving small tasks and then analyzing with me the results. During that sessions I have gathered many new tips related debugging and also started feeling much more confidently working with WDM.

WHAT I HAVE SEEN WHILE DEBUGGING?

During debugging I have found the cause of the crash on usbhub unload and done preliminary fix. Then I was able to reload usbhub (but with memory leaks). Also at that time I was still having issue in case when I was trying to remove usbhub with usbccgp loaded on top of it. So I have gone forward and started debugging of that case, which shows that we have a bunch of issues in usbhub's unload flow. I have investigated documentation related PnP handling in WDM and reviewed our drivers from that perspective. Investigation shows that existing USB stack from top to down have a lot of bugs in PnP requests handling. I have reported all my observations to my mentor, and we have started analysis together.

WHAT we have decided to do?

After long discussions and analyzation of ours and other's sources, we have decided to improve our sources to be according MSDN programming guides for PnP handling. This will allow us to mark as fixed many reported bugs related crashes on unplugging, unloading/disabling issues and so on. As bugs are presented in all stack, we will start from usbhub’s PDO layer and will step-by-step move deeper into stack. There is lot of things to do, so I am considering this task as a great improvement in ROS's USB stack.

WHAT WE HAVE NOW?

During this week I have fixed two issues causing system crash, so now we are able to uninstall usbhub with usbccgp sitting on top of it.  However, we still have many memory leaks and these are only fixes for particular issues in usbhub.