/* usb/endpoint.h
 *
 * (c) 2002 Simtec Electronics
 *
 * Ben Dooks
 *
 * endpoint function definitions
 *
 * $Id: endpoint.h,v 1.11 2003/10/20 13:24:09 ben Exp $
 *
 * This Library file is part of the Simtec Electronics USB stack development
 *   suite.
 * Specific licence is granted to use this file by third parties for the
 *   development of USB device drivers.
 *
 */

#ifndef __USB_ENDPOINT_H
#define __USB_ENDPOINT_H "$Id: endpoint.h,v 1.11 2003/10/20 13:24:09 ben Exp $"

#ifndef __USB_TYPE_ENDPOINT

typedef struct usb_endpoint_s * usb_endpoint_t;
#define __USB_TYPE_ENDPOINT __FILE__

#endif

/** Register an endpoint with the USB system.</para>

<para>This call is normally used only internally when a configuration for a
device has been set requiring endpoints using this configuration to be
established. For every registered device a default pipe must be established.

@memo Register an endpoint with the USB system.
@param usb_dev device
@param ep_no end point number
@param type transfer type
@param max_data_size maximum data payload size
@param frame_repeat Number of frames that must pass until the next requests can be sent/recieved
@param result pointer to result code
@return pointer to endpoint
@see SWI_USB_EndpointRegister
*/

struct usb_endpoint_s*
usb_endpoint_register(struct usb_device_s *usb_dev,
		      unsigned long ep_no,
		      unsigned long type,
		      unsigned long max_data_size,
		      unsigned long frame_repeat,
		      int *result);


/** De-register an endpoint with the USB system.
@memo De-register an endpoint with the USB system.
@param endpoint endpoint to re-register from the create call.
@see SWI_USB_EndpointDeregister
@return result code.
*/
extern int usb_endpoint_deregister(struct usb_endpoint_s * endpoint);

#endif /* __USB_ENDPOINT_H */
