/*
 *               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 __IOSUSB_H__
#define __IOSUSB_H__
#include <iosusbtypes.h>

#define IUSB_WriteCtrlMsg(fd, reqType, request, value, \
             index, length, data) \
       IUSB_CtrlMsg(fd, reqType, request, value, index, length, 1, data)
#define IUSB_ReadCtrlMsg(fd, reqType, request, value, \
             index, length, data) \
       IUSB_CtrlMsg(fd, reqType, request, value, index, length, 0, data)
           
IOSError IUSB_RegisterResourceManager(IOSCid fd, IOSMessageQueueId mq);
IOSError  IUSB_UnregisterResourceManager(IOSCid fd);
IOSError  IUSB_FindDevice(u16 vendorId, u16 productId,
                            char *buf, int bufsize);
IOSError IUSB_FindDeviceIds(u16 vendorId, u16 productId, IOSCid *fd);
IOSCid IUSB_GetHcdQid(IOSCid fd);
IOSError IUSB_ResetDevice(IOSCid fd); 
IOSError IUSB_ResetEndpoint(IOSCid fd, u8 ep); 
IOSError IUSB_GetDevDescr(IOSCid fd, USB_DevDescr_t *devDescr);
IOSError IUSB_GetConfDescr(IOSCid fd, USB_ConfDescr_t *confDescr);

s32 IUSB_CtrlMsg(IOSCid fd, u8 reqType, u8 request, u16 value,
             u16 index, u16 length, u8 dir, char *data);

s32 IUSB_GetStr(IOSCid fd, u16 index, u16 langid, u32 buflen, char *buf);
s32 IUSB_GetAsciiStr(IOSCid fd, u16 index, u16 langid, u32 buflen, char *buf);
s32 IUSB_ReadBulkMsg(IOSCid fd, u32 ep, u32 buflen, char *buf);
s32 IUSB_WriteBulkMsg(IOSCid fd, u32 ep, u32 buflen, char  *buf);
s32 IUSB_ReadIntrMsg(IOSCid fd, u32 ep, u32 buflen, char *buf);
s32 IUSB_WriteIntrMsg(IOSCid fd, u32 ep, u32 buflen, char *buf);

#endif /* __IOSUSB_H__ */
