/* usb2/structs.h
 *
 * (c) 2002,2003 Simtec Electronics
 *
 * Ben Dooks
 *
 * USB structures for USB2
 *
 * $Id: structs.h,v 1.4 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_STRUCTS_H
#define __USB2_STRUCTS_H "$Id: structs.h,v 1.4 2003/10/21 19:31:45 ben Exp $"

#ifndef __USB_USB_H
#error "Include usb/usb.h before this file"
#endif

/* the usb_tt_t is a marker for the usb2 `transaction translator` that is
 * placed in usb hubs to convert high-speed transactions into full or low
 * speed. This really only has implications for the usb hub driver and the
 * host-controller involved (as it has to deal with scheduling and error
 * recovery for these devices)
*/

struct usb_tt_s {
  usb_device_t       *tt_device;         /* device (hub) we're connected to */
  unsigned short      tt_port;           /* port */
  unsigned short      tt_flags;          /* flags */
};

typedef struct usb_tt_s usb_tt_t;

/* usb2_device_s (usb2_dev_t)
 *
 * device structure, compromising everything that the traditional device
 * contained, with the new bits for usb2.
*/

struct usb2_device_s {
  struct usb_device_s     usb_dev;           /* original usb device */

  unsigned short          magic;             /* magic no */
  unsigned short          version;           /* usb standard version (*100) */
  usb_tt_t               *tt;                /* transaction translator */
};

typedef struct usb2_device_s usb2_dev_t;


struct usb2_endpoint_s {
  struct usb_endpoint_s   usb_ep;            /* original endpoint */
};

#endif /* __USB2_STRUCTS_H */
