external USB 3.0 hub support.
-/* $OpenBSD: usb.h,v 1.46 2014/03/08 11:47:26 mpi Exp $ */
+/* $OpenBSD: usb.h,v 1.47 2014/08/08 14:20:05 mpi Exp $ */
/* $NetBSD: usb.h,v 1.69 2002/09/22 23:20:50 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb.h,v 1.14 1999/11/17 22:33:46 n_hibma Exp $ */
uByte DeviceRemovable[32]; /* max 255 ports */
#define UHD_NOT_REMOV(desc, i) \
(((desc)->DeviceRemovable[(i)/8] >> ((i) % 8)) & 1)
- /* deprecated */ uByte PortPowerCtrlMask[1];
} __packed usb_hub_descriptor_t;
-#define USB_HUB_DESCRIPTOR_SIZE 9 /* includes deprecated PortPowerCtrlMask */
+#define USB_HUB_DESCRIPTOR_SIZE 8
+
+typedef struct {
+ uByte bDescLength;
+ uByte bDescriptorType;
+ uByte bNbrPorts;
+ uWord wHubCharacteristics;
+ uByte bPwrOn2PwrGood; /* delay in 2 ms units */
+ uByte bHubContrCurrent;
+ uByte bHubHdrDecLat;
+ uWord wHubDelay;
+ uByte DeviceRemovable[32]; /* max 255 ports */
+} __packed usb_hub_ss_descriptor_t;
+#define USB_HUB_SS_DESCRIPTOR_SIZE 11
typedef struct {
uByte bLength;
-/* $OpenBSD: usbdi_util.c,v 1.37 2014/07/09 15:47:54 mpi Exp $ */
+/* $OpenBSD: usbdi_util.c,v 1.38 2014/08/08 14:20:05 mpi Exp $ */
/* $NetBSD: usbdi_util.c,v 1.40 2002/07/11 21:14:36 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdi_util.c,v 1.14 1999/11/17 22:33:50 n_hibma Exp $ */
return (usbd_do_request(dev, &req, hd));
}
+usbd_status
+usbd_get_hub_ss_descriptor(struct usbd_device *dev, usb_hub_ss_descriptor_t *hd,
+ uint8_t nports)
+{
+ usb_device_request_t req;
+ uint16_t len = USB_HUB_SS_DESCRIPTOR_SIZE + (nports + 1) / 8;
+
+ req.bmRequestType = UT_READ_CLASS_DEVICE;
+ req.bRequest = UR_GET_DESCRIPTOR;
+ USETW2(req.wValue, UDESC_SS_HUB, 0);
+ USETW(req.wIndex, 0);
+ USETW(req.wLength, len);
+ return (usbd_do_request(dev, &req, hd));
+}
+
usbd_status
usbd_get_port_status(struct usbd_device *dev, int port, usb_port_status_t *ps)
{
-/* $OpenBSD: usbdi_util.h,v 1.26 2014/07/09 15:47:54 mpi Exp $ */
+/* $OpenBSD: usbdi_util.h,v 1.27 2014/08/08 14:20:05 mpi Exp $ */
/* $NetBSD: usbdi_util.h,v 1.28 2002/07/11 21:14:36 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdi_util.h,v 1.9 1999/11/17 22:33:50 n_hibma Exp $ */
usbd_status usbd_get_hub_status(struct usbd_device *, usb_hub_status_t *);
usbd_status usbd_get_hub_descriptor(struct usbd_device *,
usb_hub_descriptor_t *, uint8_t);
+usbd_status usbd_get_hub_ss_descriptor(struct usbd_device *,
+ usb_hub_ss_descriptor_t *, uint8_t);
struct usb_hid_descriptor *usbd_get_hid_descriptor(struct usbd_device *,
usb_interface_descriptor_t *);
usbd_status usbd_get_report(struct usbd_device *, int, int, int, void *,