00001 #include "devices/usb.h" 00002 //103041996760879 00003 #include "devices/usb_hub.h" 00004 #include <lib/debug.h> 00005 00006 #define USB_CLASS_HUB 0x09 00007 00008 #define REQ_HUB_GET_STATUS 0 00009 #define REQ_HUB_CLEAR_FEATURE 1 00010 #define REQ_HUB_SET_FEATURE 2 00011 #define REQ_HUB_GET_DESC 6 00012 #define REQ_HUB_SET_DESC 7 00013 #define REQ_HUB_CLEAR_TT_BUF 8 00014 #define REQ_HUB_RESET_TT 9 00015 #define REQ_HUB_GET_TT_STATE 10 00016 #define REQ_HUB_STOP_TT 11 00017 00018 #define HUB_SEL_HUB_POWER 0 00019 #define HUB_SEL_OVER_CURRENT 1 00020 #define HUB_SEL_PORT_CONN 0 00021 #define HUB_SEL_PORT_ENABLE 1 00022 #define HUB_SEL_PORT_SUSPEND 2 00023 #define HUB_SEL_PORT_OVER_CURRENT 3 00024 #define HUB_SEL_PORT_RESET 4 00025 #define HUB_SEL_PORT_POWER 8 00026 #define HUB_SEL_PORT_LOW_SPEED 9 00027 00028 #define SETUP_DESC_HUB 0x29 00029 00030 static void* hub_attached(struct usb_iface*); 00031 static void hub_detached(class_info); 00032 00033 static struct usb_class hub_class = { 00034 .attached = hub_attached, 00035 .detached = hub_detached, 00036 .class_id = USB_CLASS_HUB, 00037 .name = "hub" 00038 }; 00039 00040 00041 void usb_hub_init(void) 00042 { 00043 usb_register_class(&hub_class); 00044 } 00045 00046 00047 static void* hub_attached(struct usb_iface* ui UNUSED) 00048 { 00049 return NULL; 00050 } 00051 00052 static void hub_detached(class_info info UNUSED) 00053 { 00054 } 00055