1 typedef struct Hub Hub;
2 typedef struct DHub DHub;
3 typedef struct Port Port;
9 Dhub = 0x29, /* hub descriptor type */
10 Dhublen = 9, /* hub descriptor length */
12 /* hub class feature selectors */
23 Fcportconnection = 16,
26 Fcportovercurrent= 19,
30 /* Port status and status change bits
31 * Constants at /sys/src/9/pc/usb.h starting with HP-
32 * must have the same values or root hubs won't work.
37 PSovercurrent = 0x0008,
43 PSstatuschg = 0x10000, /* PSpresent changed */
44 PSchange = 0x20000, /* PSenable changed */
47 /* port/device state */
48 Pdisabled = 0, /* must be 0 */
52 /* Delays, timeouts (ms) */
53 // Spawndelay = 1000, /* how often may we re-spawn a driver */
54 Spawndelay = 250, /* how often may we re-spawn a driver */
55 // Connectdelay = 1000, /* how much to wait after a connect */
56 Connectdelay = 500, /* how much to wait after a connect */
57 Resetdelay = 20, /* how much to wait after a reset */
58 Enabledelay = 20, /* how much to wait after an enable */
59 Powerdelay = 100, /* after powering up ports */
60 Pollms = 250, /* port poll interval */
61 Chgdelay = 100, /* waiting for port become stable */
62 Chgtmout = 1000, /* ...but at most this much */
65 * device tab for embedded usb drivers.
67 DCL = 0x01000000, /* csp identifies just class */
68 DSC = 0x02000000, /* csp identifies just subclass */
69 DPT = 0x04000000, /* csp identifies just proto */
77 uchar pwrms; /* time to wait in ms */
78 uchar maxcurrent; /* after powering port*/
79 int leds; /* has port indicators? */
83 int failed; /* I/O error while enumerating */
84 int isroot; /* set if root hub */
85 Dev *dev; /* for this hub */
86 Hub *next; /* in list of hubs */
91 int state; /* state of the device */
92 int sts; /* old port status */
95 Dev *dev; /* attached device (if non-nil) */
96 Hub *hub; /* non-nil if hub attached */
97 int devnb; /* device number */
98 uvlong *devmaskp; /* ptr to dev mask */
101 /* USB HUB descriptor */
105 uchar bDescriptorType;
107 uchar wHubCharacteristics[2];
108 uchar bPwrOn2PwrGood;
109 uchar bHubContrCurrent;
110 uchar DeviceRemovable[1]; /* variable length */