some routines for removing a device on demand. thist do not work properly
[ppcskel.git] / usb / core / core.h
index b906bf2c6463b60e1831c49443e726db8b3e36e6..98ab7ea3641581a53f191cd7088123f4ee6d4e6e 100644 (file)
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+/*
+       ppcskel - a Free Software replacement for the Nintendo/BroadOn bootloader.
+       plugmii core
+
+Copyright (C) 2009     Bernhard Urban <lewurm@gmx.net>
+Copyright (C) 2009     Sebastian Falbesoner <sebastian.falbesoner@gmail.com>
+
+# This code is licensed to you under the terms of the GNU GPL, version 2;
+# see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
+*/
 
 #ifndef _CORE_H_
 #define _CORE_H_
@@ -49,6 +59,7 @@ inline static void wait_ms(int ms)
 struct usb_device {
        u8 address;
        u8 fullspeed;
+       u32 ohci;
 
        /* device descriptor */
        u8 bLength;
@@ -134,7 +145,8 @@ struct usb_driver {
        char* name;
        void (*probe)(void);
        void (*check)(void);
-       void * data;
+       void (*remove)(void);
+       void *data;
        struct usb_driver *next;
 };
 
@@ -166,6 +178,7 @@ struct usb_transfer_descriptor {
        u8 devaddress;
        u8 endpoint;
        u8 fullspeed;
+       u8 type;
        
        // TODO: zusammenfassen!
        u8 pid;
@@ -188,12 +201,12 @@ struct usb_core {
        struct list *devices;
 } core;
 
-void usb_init();
+void usb_init(u32 reg);
 void usb_periodic();
 u8 usb_next_address();
 
 
-struct usb_device *usb_add_device(u8 lowspeed);
+struct usb_device *usb_add_device(u8 lowspeed, u32 reg);
 u8 usb_remove_device(struct usb_device *dev);
 u8 usb_register_driver(struct usb_driver *driver);
 void usb_probe_driver();