2 ppcskel - a Free Software replacement for the Nintendo/BroadOn bootloader.
5 Copyright (C) 2009 Bernhard Urban <lewurm@gmx.net>
6 Copyright (C) 2009 Sebastian Falbesoner <sebastian.falbesoner@gmail.com>
8 # This code is licensed to you under the terms of the GNU GPL, version 2;
9 # see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
12 #include "../core/core.h"
13 #include "../core/usb.h"
14 #include "../usbspec/usb11spec.h"
15 #include "../../malloc.h"
16 #include "../../string.h"
20 struct usb_driver btdriv = {
22 .probe = usb_bt_probe,
23 .check = usb_bt_check,
24 .remove = usb_bt_remove,
28 u8 epi_it, epi_bk, epo_bk;
33 usb_register_driver(&btdriv);
35 usb_set_configuration(btdriv.data, btdriv.data->conf->bConfigurationValue);
36 printf("get_conf: %d\n", usb_get_configuration(btdriv.data));
40 usb_control_msg(btdriv.data, 0x01, SET_INTERFACE, 0, 1, 0, buf, 0);
42 epi_it = btdriv.data->conf->intf->endp->bEndpointAddress & 0x7F;
43 epi_bk = btdriv.data->conf->intf->endp->next->bEndpointAddress & 0x7F;
44 epo_bk = btdriv.data->conf->intf->endp->next->next->bEndpointAddress & 0x7F;
46 btdriv.data->epSize[1] = btdriv.data->conf->intf->endp->wMaxPacketSize;
47 btdriv.data->epSize[2] = btdriv.data->conf->intf->endp->next->wMaxPacketSize;
48 btdriv.data->epSize[3] = btdriv.data->conf->intf->endp->next->next->wMaxPacketSize;
53 struct usb_device *dev;
54 struct element *iterator = core.devices->head;
56 while(iterator != NULL) {
57 dev = (struct usb_device*) iterator->data;
62 if(dev->idVendor == 0x057e && dev->idProduct == 0x0305) {
66 iterator=iterator->next;
76 return btdriv.data ? 1 : 0;