From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <445A8E96.7040203@austin.rr.com> Date: Thu, 4 May 2006 18:30:30 -0500 From: Lonnie Mendez User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923) MIME-Version: 1.0 To: 9fans@cse.psu.edu Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [9fans] problem with usbd (hub.c) and qemu Topicbox-Message-UUID: 4cf2864c-ead1-11e9-9d60-3106f5b1d025 I had a go with qemu, plan9, and usb again. This time it's progressing much farther except another wall has been hit. usbstart got things going up to a certain point. Running /bin/usb/usbd -d yielded this information: usbd: usb0/0.1: hub 1 attached pdesc 1.-1 [10] desc 1.-1 [9] 0x29: nport 8 charac 0x000a pwr 2ms current 0mA remov 0x00 usbd: hub descriptor too small % To me qemu's hub descriptor size calculation is sane. Looking at http://cm.bell-labs.com/sources/plan9/sys/src/cmd/usb/usbd/hub.c:newhub() pdesc(d, -1, -1, buf, nr); dd = (DHub*)buf; nport = dd->bNbrPorts; nmap = 1 + nport/8; if(nr < 7 + 2*nmap) { fprint(2, "usbd: hub descriptor too small\n"); free(h); return nil; } the hub size for a hub with 8+ ports isn't being calculated correctly. In this instance for a hub with 8 ports the code expects 11 bytes when the hub descriptor size is 10 bytes. Please see usb_20 11.23.2.1 or usb11 11.15.2 concerning DeviceRemovable and PortPwrCtrlMask. Source for the qemu hub is located here: http://cvs.savannah.nongnu.org/viewcvs/qemu/hw/usb-hub.c?rev=1.3&root=qemu&view=markup usb_hub_handle_control() - switch case GetHubDescriptor