Gadget drivers rely on common USB structures and constants defined in the <linux/usb/ch9.h> header file, which is standard in Linux 2.6 kernels. These are the same types and constants used by host side drivers (and usbcore).
<linux/usb/ch9.h>