patch-2.2.18 linux/drivers/usb/hub.h
Next file: linux/drivers/usb/ibmcam.c
Previous file: linux/drivers/usb/hub.c
Back to the patch index
Back to the overall index
- Lines: 107
- Date:
Fri Sep 8 17:20:01 2000
- Orig file:
v2.2.17/drivers/usb/hub.h
- Orig date:
Fri Apr 21 12:46:37 2000
diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.17/drivers/usb/hub.h linux/drivers/usb/hub.h
@@ -4,7 +4,14 @@
#include <linux/list.h>
/*
- * Hub feature numbers
+ * Hub request types
+ */
+
+#define USB_RT_HUB (USB_TYPE_CLASS | USB_RECIP_DEVICE)
+#define USB_RT_PORT (USB_TYPE_CLASS | USB_RECIP_OTHER)
+
+/*
+ * Hub Class feature numbers
*/
#define C_HUB_LOCAL_POWER 0
#define C_HUB_OVER_CURRENT 1
@@ -12,6 +19,7 @@
/*
* Port feature numbers
*/
+#define USB_PORT_FEAT_CONNECTION 0
#define USB_PORT_FEAT_ENABLE 1
#define USB_PORT_FEAT_SUSPEND 2
#define USB_PORT_FEAT_OVER_CURRENT 3
@@ -24,7 +32,12 @@
#define USB_PORT_FEAT_C_OVER_CURRENT 19
#define USB_PORT_FEAT_C_RESET 20
-/* wPortStatus */
+struct usb_port_status {
+ __u16 wPortStatus;
+ __u16 wPortChange;
+} __attribute__ ((packed));
+
+/* wPortStatus bits */
#define USB_PORT_STAT_CONNECTION 0x0001
#define USB_PORT_STAT_ENABLE 0x0002
#define USB_PORT_STAT_SUSPEND 0x0004
@@ -33,18 +46,46 @@
#define USB_PORT_STAT_POWER 0x0100
#define USB_PORT_STAT_LOW_SPEED 0x0200
-/* wPortChange */
+/* wPortChange bits */
#define USB_PORT_STAT_C_CONNECTION 0x0001
#define USB_PORT_STAT_C_ENABLE 0x0002
#define USB_PORT_STAT_C_SUSPEND 0x0004
#define USB_PORT_STAT_C_OVERCURRENT 0x0008
#define USB_PORT_STAT_C_RESET 0x0010
-/* Characteristics */
+/* wHubCharacteristics (masks) */
#define HUB_CHAR_LPSM 0x0003
#define HUB_CHAR_COMPOUND 0x0004
#define HUB_CHAR_OCPM 0x0018
+struct usb_hub_status {
+ __u16 wHubStatus;
+ __u16 wHubChange;
+} __attribute__ ((packed));
+
+/*
+ *Hub Status & Hub Change bit masks
+ */
+#define HUB_STATUS_LOCAL_POWER 0x0001
+#define HUB_STATUS_OVERCURRENT 0x0002
+
+#define HUB_CHANGE_LOCAL_POWER 0x0001
+#define HUB_CHANGE_OVERCURRENT 0x0002
+
+#define HUB_DESCRIPTOR_MAX_SIZE 39 /* enough for 127 ports on a hub */
+
+/* Hub descriptor */
+struct usb_hub_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bNbrPorts;
+ __u16 wHubCharacteristics;
+ __u8 bPwrOn2PwrGood;
+ __u8 bHubContrCurrent;
+ /* DeviceRemovable and PortPwrCtrlMask want to be variable-length
+ bitmaps that hold max 256 entries, but for now they're ignored */
+} __attribute__ ((packed));
+
struct usb_device;
typedef enum {
@@ -67,6 +108,14 @@
/* Device structure */
struct usb_device *dev;
+ /* Interrupt polling pipe */
+ struct urb *urb;
+
+ char buffer[USB_MAXCHILDREN / 8];
+
+ /* List of hubs */
+ struct list_head hub_list;
+
/* Temporary event list */
struct list_head event_list;
@@ -77,4 +126,3 @@
};
#endif
-
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)