/*
 *              Copyright (C) 2005, BroadOn Communications Corp.
 *
 * These coded instructions, statements, and computer programs contain
 * unpublished  proprietary information of BroadOn Communications Corp.,
 * and  are protected by Federal copyright law. They may not be disclosed
 * to  third  parties or copied or duplicated in any form, in whole or in
 * part, without the prior written consent of BroadOn Communications Corp.
 *
 */

#ifndef __NC_USB_DEV_H_
#define __NC_USB_DEV_H_

#if 0
#define USB_LOG(...)   printf("USB: " __VA_ARGS__) 
#define USB_DEBUG(...)   printf("USB DEBUG: " __VA_ARGS__) 
#define USB_ERROR(...)  printf("USB ERROR: " __VA_ARGS__)
#else
#define USB_LOG(...)   
#define USB_DEBUG(...)  
#define USB_ERROR(...)
#endif

#define DCACHE_ALIGN  __attribute__ ((aligned (16)))

typedef struct {
    /* RM */
    IOSError (* skOpen) (IOSResourceRequest *req);
    IOSError (* skClose) (IOSResourceRequest *req);
    IOSError (* skIoctl) (IOSResourceRequest *req);
    IOSError (* skRead) (IOSResourceRequest *req);
    IOSError (* skWrite) (IOSResourceRequest *req);

    /* Usb services */
    IOSError (* devReset) ();
    IOSError (* devInit) (int iso);
    IOSError (* devExit) ();
    IOSError (* devSuspend) ();
    IOSError (* devUnplug) ();
    IOSError (* devEp0Recv) (int evt, int len);
    IOSError (* devEp0Send) (int evt, int len);
    IOSError (* devEp1Recv) (int evt, int len);
    IOSError (* devEp1Send) (int evt, int len);
    IOSError (* devEp2Send) (int evt, int len);
    IOSError (* devEp3Recv) (int evt, int len);

} USBDeviceFuncs;

typedef struct {
    USBDeviceFuncs *pFuncs;      /* Function table */
    u8  inUse;                   
    u8  devType;
} USBDeviceContext;

#endif

