/* usb2/endpoint.h
 *
 * (c) 2002,2003 Simtec Electronics
 *
 * Ben Dooks
 *
 * endpoint function definitions for usb2
 *
 * $Id: endpoint.h,v 1.6 2003/10/21 19:31:45 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 __USB2_ENDPOINT_H
#define __USB2_ENDPOINT_H "$Id: endpoint.h,v 1.6 2003/10/21 19:31:45 ben Exp $"

/* usb2 endpoints
 *
 * we gather extra information for usb endpoints, partially from the
 * new endpoint descriptor information, and partially information for
 * an application's use if it understands the new structures.
 *
 * the following are found in the ep_info union of the new endpoint 
 * structures
 *
 *    bmAttributes   - for sybchronisation types
 *    wMaxPacketSize - top bits significant for usb2
 *    bInterval      - kept in raw form
*/

struct usb_ep2_reginfo_s {
  unsigned long     flags;            /* flags (USB_EPFLAG_*) */
  unsigned long     type;
  unsigned long     max_data_size;
  unsigned long     frame_repeat;     /* in frames or microframes */
  usb_ep_info_t     info;             /* copy into union */
};

typedef struct usb_ep2_reginfo_s usb_ep2_reginfo_t;

/** Register an endpoint with the USB system (USB2).</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 ep_reg registration information for the endpoint
@param result pointer to result code
@return pointer to endpoint
@see SWI_USB_EndpointRegister2
*/

struct usb_endpoint_s*
usb_endpoint_register2(struct usb_device_s *usb_dev,
		       unsigned long ep_no,
		       struct usb_ep2_reginfo_s *ep_reg,
		       int *result);



#endif /* __USB2_ENDPOINT_H */
