- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

# include/usb/function_core.h

Go to the documentation of this file.

    00001
    00041 #ifndef USB_FUNC_CORE_H_INCLUDED
    00042 #define USB_FUNC_CORE_H_INCLUDED
    00043
    00044 #include <buffer.h>
    00045
    00046 struct usb_func_iface;
    00047 struct usb_configuration_descriptor;
    00048 struct usb_setup_req;
    00049 struct udc;
    00050
    00054 struct usb_func_iface_ops {
    00064         int     (*enable)(struct udc *udc, struct usb_func_iface *iface);
    00071         void    (*disable)(struct udc *udc, struct usb_func_iface *iface);
    00083         int     (*setup)(struct udc *udc, struct usb_func_iface *iface,
    00084                         struct usb_setup_req *req);
    00085 };
    00086
    00090 struct usb_func_iface_setting {
    00092         const struct usb_func_iface_ops *ops;
    00093
    00095         const struct usb_interface_descriptor   *fs_desc;
    00097         size_t                          fs_desc_size;
    00099         const struct usb_interface_descriptor   *hs_desc;
    00101         size_t                          hs_desc_size;
    00103         struct buffer                   desc_buf;
    00104 };
    00105
    00109 struct usb_func_iface {
    00111         struct usb_func_iface_setting   *cur_setting;
    00113         size_t                          nr_settings;
    00115         struct usb_func_iface_setting   setting[1];
    00116 };
    00117
    00124 struct usb_func_config {
    00129         struct usb_func_iface           **interface;
    00131         struct usb_configuration_descriptor *desc;
    00132 };
    00133
    00134 extern void usb_func_add_interface(struct usb_func_config *config,
    00135                 struct usb_func_iface *iface);
    00136 extern struct usb_func_config *usb_func_add_config(
    00137                 struct usb_configuration_descriptor *desc);
    00138
    00139 #endif /* USB_FUNC_CORE_H_INCLUDED */