Include Path: |
|
Path: |
/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/IOKit/usb/USBHub.h |
Includes: |
|
Overview
This header contains the constants and definitions used with USB hub devices.
Typedefs
See Also:
-
IOUSBHubDescriptor
typedef struct IOUSBHubDescriptor IOUSBHubDescriptor;
Discussion
USB Hub Descriptor. See the USB HID Specification at http://www.usb.org.
typedef struct IOUSBHubPortReEnumerateParam IOUSBHubPortReEnumerateParam;
Discussion
Used to specify the port that needs to be reenumerated
See Also:
-
IOUSBHubStatus
typedef struct IOUSBHubStatus IOUSBHubStatus;
Discussion
Used to get the port status and change flags using GetPortStatus()
Structs and Unions
See Also:
-
IOUSBHubDescriptor
struct IOUSBHubDescriptor {
UInt8 length;
UInt8 hubType;
UInt8 numPorts;
UInt16 characteristics __attribute__((packed));
UInt8 powerOnToGood;
UInt8 hubCurrent;
UInt8 removablePortFlags[8];
UInt8 pwrCtlPortFlags[8];
};
Discussion
USB Hub Descriptor. See the USB HID Specification at http://www.usb.org.
See Also:
-
IOUSBHubStatus
struct IOUSBHubStatus {
UInt16 statusFlags;
UInt16 changeFlags;
};
Discussion
Used to get the port status and change flags using GetPortStatus()
Enumerations
enum {
kUSBHubDescriptorType = 0x29
};
enum {
kClearHubFeature = (
(
(
UInt16)kUSBRqClearFeature << 8) + (
(
UInt16) kUSBDevice + (
(
UInt16) kUSBClass << kUSBRqTypeShift) + (
(
UInt16) kUSBOut << kUSBRqDirnShift))),
kClearPortFeature = (
(
(
UInt16)kUSBRqClearFeature << 8) + (
(
UInt16) kUSBOther + (
(
UInt16) kUSBClass << kUSBRqTypeShift) + (
(
UInt16) kUSBOut << kUSBRqDirnShift))),
kGetPortState = (
(
(
UInt16)kUSBRqGetState << 8) + (
(
UInt16) kUSBOther + (
(
UInt16) kUSBClass << kUSBRqTypeShift) + (
(
UInt16) kUSBIn << kUSBRqDirnShift))),
kGetHubDescriptor = (
(
(
UInt16)kUSBRqGetDescriptor << 8) + (
(
UInt16) kUSBDevice + (
(
UInt16) kUSBClass << kUSBRqTypeShift) + (
(
UInt16) kUSBIn << kUSBRqDirnShift))),
kGetHubStatus = (
(
(
UInt16)kUSBRqGetStatus << 8) + (
(
UInt16) kUSBDevice + (
(
UInt16) kUSBClass << kUSBRqTypeShift) + (
(
UInt16) kUSBIn << kUSBRqDirnShift))),
kGetPortStatus = (
(
(
UInt16)kUSBRqGetStatus << 8) + (
(
UInt16) kUSBOther + (
(
UInt16) kUSBClass << kUSBRqTypeShift) + (
(
UInt16) kUSBIn << kUSBRqDirnShift))),
kSetHubDescriptor = (
(
(
UInt16)kUSBRqGetDescriptor << 8) + (
(
UInt16) kUSBDevice + (
(
UInt16) kUSBClass << kUSBRqTypeShift) + (
(
UInt16) kUSBOut << kUSBRqDirnShift))),
kSetHubFeature = (
(
(
UInt16)kUSBRqSetFeature << 8) + (
(
UInt16) kUSBDevice + (
(
UInt16) kUSBClass << kUSBRqTypeShift) + (
(
UInt16) kUSBOut << kUSBRqDirnShift))),
kSetPortFeature = (
(
(
UInt16)kUSBRqSetFeature << 8) + (
(
UInt16) kUSBOther + (
(
UInt16) kUSBClass << kUSBRqTypeShift) + (
(
UInt16) kUSBOut << kUSBRqDirnShift)))
};
Discussion
Encoding of the hub specific standard requests
Request bmRequestType bRequest wValue wIndex wLength Data
ClearHubFeature 0010 0000B CLEAR_FEATURE Feature Zero Zero None
ClearPortFeature 0010 0011B Feature Port Zero None
GetBusState 1010 0011B GET_STATE Zero Port One Port Bus State
GetHubDescriptor 1010 0000B GET_DESCRIPTOR Type Zero Length Descriptor
GetHubStatus 1010 0000B GET_STATUS Zero Zero Four Hub Status
GetPortStatus 1010 0011B Zero Port Four Port Status
SetHubDescriptor 0010 0000B SET_DESCRIPTOR Type Zero Length Descriptor
SetHubFeature 0010 0000B SET_FEATURE Feature Zero Zero None
SetPortFeature 0010 0011B Feature Port Zero None
enum {
kPerPortSwitchingBit = (
1 << 0),
kNoPowerSwitchingBit = (
1 << 1),
kCompoundDeviceBit = (
1 << 2),
kPerPortOverCurrentBit = (
1 << 3),
kNoOverCurrentBit = (
1 << 4),
kHubPortIndicatorBit = 7,
kHubPortIndicatorMask = 0x0080
};
enum {
kUSBHubLocalPowerChangeFeature = 0,
kUSBHubOverCurrentChangeFeature = 1,
kUSBHubPortConnectionFeature = 0,
kUSBHubPortEnableFeature = 1,
kUSBHubPortSuspendFeature = 2,
kUSBHubPortOverCurrentFeature = 3,
kUSBHubPortResetFeature = 4,
kUSBHubPortPowerFeature = 8,
kUSBHubPortLowSpeedFeature = 9,
kUSBHubPortConnectionChangeFeature = 16,
kUSBHubPortEnableChangeFeature = 17,
kUSBHubPortSuspendChangeFeature = 18,
kUSBHubPortOverCurrentChangeFeature = 19,
kUSBHubPortResetChangeFeature = 20,
kUSBHubPortTestFeature = 21,
kUSBHubPortIndicatorFeature = 22
};
Discussion
Used with SET_FEATURE to set hub and port features
enum {
kHubPortConnection = 0x0001,
kHubPortEnabled = 0x0002,
kHubPortSuspend = 0x0004,
kHubPortOverCurrent = 0x0008,
kHubPortBeingReset = 0x0010,
kHubPortPower = 0x0100,
kHubPortLowSpeed = 0x0200,
kHubPortHighSpeed = 0x0400,
kHubPortTestMode = 0x0800,
kHubPortIndicator = 0x1000,
kHubPortStateChangeMask = kHubPortConnection | kHubPortEnabled | kHubPortSuspend | kHubPortOverCurrent | kHubPortBeingReset
};
Discussion
Used to decode the Port Status and Change
enum {
kHubLocalPowerStatus = 1,
kHubOverCurrentIndicator = 2,
kHubLocalPowerStatusChange = 1,
kHubOverCurrentIndicatorChange = 2
};
Discussion
Used to decode the Hub Status and Change
enum {
kHubPortIndicatorAutomatic = 0,
kHubPortIndicatorAmber,
kHubPortIndicatorGreen,
kHubPortIndicatorOff
};
enum {
kHubSupportsGangPower = 0,
kHubSupportsIndividualPortPower = 1,
kHubPortSetPowerOff = 0,
kHubPortSetPowerOn = 1
};
|
Did this document help you? |
Yes: Tell us what works for you.
|
|
Last Updated: 2008-12-19