1 typedef struct Hub Hub;
2 typedef struct DHub DHub;
3 typedef struct DSSHub DSSHub;
4 typedef struct Port Port;
10 Dhub = 0x29, /* hub descriptor type */
11 Dhublen = 9, /* hub descriptor length */
13 Dsshub = 0x2A, /* superspeed hub descriptor type */
14 Dsshublen = 12, /* superspeed hub descriptor length */
16 /* hub class feature selectors */
27 Fcportconnection = 16,
30 Fcportovercurrent= 19,
34 /* Port status and status change bits
35 * Constants at /sys/src/9/pc/usb.h starting with HP-
36 * must have the same values or root hubs won't work.
41 PSovercurrent = 0x0008,
47 PSstatuschg = 0x10000, /* PSpresent changed */
48 PSchange = 0x20000, /* PSenable changed */
51 /* port/device state */
52 Pdisabled = 0, /* must be 0 */
56 /* Delays, timeouts (ms) */
57 Spawndelay = 250, /* how often may we re-spawn a driver */
58 Resetdelay = 20, /* how much to wait after a reset */
59 Enabledelay = 20, /* how much to wait after an enable */
60 Powerdelay = 100, /* after powering up ports */
61 Pollms = 250, /* port poll interval */
62 Chgdelay = 100, /* waiting for port become stable */
63 Chgtmout = 1000, /* ...but at most this much */
66 * device tab for embedded usb drivers.
68 DCL = 0x01000000, /* csp identifies just class */
69 DSC = 0x02000000, /* csp identifies just subclass */
70 DPT = 0x04000000, /* csp identifies just proto */
78 uchar pwrms; /* time to wait in ms */
79 uchar maxcurrent; /* after powering port*/
80 int leds; /* has port indicators? */
84 int failed; /* I/O error while enumerating */
85 int isroot; /* set if root hub */
86 Dev *dev; /* for this hub */
87 Hub *next; /* in list of hubs */
92 int state; /* state of the device */
93 u32int sts; /* old port status */
96 Dev *dev; /* attached device (if non-nil) */
97 Hub *hub; /* non-nil if hub attached */
100 /* USB HUB descriptor */
104 uchar bDescriptorType;
106 uchar wHubCharacteristics[2];
107 uchar bPwrOn2PwrGood;
108 uchar bHubContrCurrent;
109 uchar DeviceRemovable[1]; /* variable length */
112 /* Superspeed HUB descriptor */
116 uchar bDescriptorType;
118 uchar wHubCharacteristics[2];
119 uchar bPwrOn2PwrGood;
120 uchar bHubContrCurrent;
123 uchar DeviceRemovable[1]; /* variable length */