IOUSBControllerV3

Inherits from
IOUSBControllerV2
Availability
Available in OS X v10.5 and later.
Declared in
IOUSBControllerV3.h

Overview

subclass of the IOUSBControllerV2 to provide support for new USB Power Management techniques.

With Leopard, we are providing more information to USB Device Drivers in the IOPower tree to allow for more efficient Power Management. This controller class encapulates many of the changes needed for that, without disturbing third party subclasses of IOUSBController or IOUSBControllerV2

Tasks

Miscellaneous

Instance Methods

GetRootHub3Descriptor

UIM function, return the hub descriptor of the simulated root hub device As GET_DESCRIPTOR control request for hub descrptor

virtual IOReturn GetRootHub3Descriptor( IOUSB3HubDescriptor *desc );
Parameters
desc

Descriptor structure to return data in

GetRootHubBOSDescriptor

UIM function, retrun the BOS descriptor of the simulated root hub device As GET_DESCRIPTOR control request for configuration descrptor

virtual IOReturn GetRootHubBOSDescriptor( OSData *desc );
Parameters
desc

Descriptor structure to return data in

GetRootHubDescriptor

UIM function, return the hub descriptor of the simulated root hub device As GET_DESCRIPTOR control request for hub descrptor

virtual IOReturn GetRootHub3Descriptor( IOUSB3HubDescriptor *desc );
Parameters
desc

Descriptor structure to return data in

GetRootHubPortErrorCount

UIM function, returns the port error count of the simulated root hub device (GET_PORT_ERROR_COUNT from the USB 3.0 spec)

virtual IOReturn GetRootHubPortErrorCount( UInt16 port, UInt16 *count );
Parameters
port

Port Number

count

Pointer to a UInt16 to store the actual link error count

Read

virtual IOReturn Read( UInt32 streamID, IOMemoryDescriptor *buffer, USBDeviceAddress address, Endpoint *endpoint, IOUSBCompletion *completion, UInt32 noDataTimeout, UInt32 completionTimeout, IOByteCount reqCount );
Parameters
streamID

stream ID of the stream to read from

buffer

place to put the transferred data

address

Address of the device on the USB bus

endpoint

description of endpoint

completion

describes action to take when buffer has been filled

noDataTimeout

number of milliseconds of no data movement before the request is aborted

completionTimeout

number of milliseonds after the command is on the bus in which it must complete

reqCount

number of bytes requested for the transfer (must not be greater than the length of the buffer)

Discussion

Read from a stream on a bulk endpoint

UIMAbortEndpoint

UIM function Abort the specified endpoint or stream, return all transactions queued on it.

virtual IOReturn UIMAbortStream( UInt32 streamID, short functionNumber, short endpointNumber, short direction);
Parameters
streamID

If zero, abort the endpoint, if non zero abort the stream on the endpoint

functionNumber

The USB device ID of the device to Abort

endpointNumber

The endpoint number to Abort

direction

Specifies direction of the endpoint for uniqueness. kUSBIn or KUSBOut.

UIMAbortStream

UIM function Abort the specified endpoint or stream, return all transactions queued on it.

virtual IOReturn UIMAbortStream( UInt32 streamID, short functionNumber, short endpointNumber, short direction);
Parameters
streamID

If zero, abort the endpoint, if non zero abort the stream on the endpoint

functionNumber

The USB device ID of the device to Abort

endpointNumber

The endpoint number to Abort

direction

Specifies direction of the endpoint for uniqueness. kUSBIn or KUSBOut.

UIMCreateBulkSSEndpoint

Create an endpoint in the controller with superspeed streams and/or maxburst capabilities if controller does not support superspeed, this method should not be overridden

virtual IOReturn UIMCreateSSBulkEndpoint( UInt8 functionNumber, UInt8 endpointNumber, UInt8 direction, UInt8 speed, UInt16 maxPacketSize, UInt32 maxStream, UInt32 maxBurst);
Parameters
functionNumber

USB device ID of device

endpointNumber

endpoint address of the endpoint in the device

direction

Direction of data flow. kUSBIn or kUSBOut

speed

speed of the device kUSBDeviceSpeedFull, kUSBDeviceSpeedHigh, kUSBDeviceSuper

maxPacketSize

maximum packet size of this endpoint

maxStreams

Maximum stream number that this endpoint can use

maxBurst

number of extra packets in a burst transfer

UIMCreateSSBulkEndpoint

Create an endpoint in the controller with superspeed streams and/or maxburst capabilities if controller does not support superspeed, this method should not be overridden

virtual IOReturn UIMCreateSSBulkEndpoint( UInt8 functionNumber, UInt8 endpointNumber, UInt8 direction, UInt8 speed, UInt16 maxPacketSize, UInt32 maxStream, UInt32 maxBurst);
Parameters
functionNumber

USB device ID of device

endpointNumber

endpoint address of the endpoint in the device

direction

Direction of data flow. kUSBIn or kUSBOut

speed

speed of the device kUSBDeviceSpeedFull, kUSBDeviceSpeedHigh, kUSBDeviceSuper

maxPacketSize

maximum packet size of this endpoint

maxStreams

Maximum stream number that this endpoint can use

maxBurst

number of extra packets in a burst transfer

UIMCreateSSInterruptEndpoint

Create an endpoint in the controller with maxburst capabilities if controller does not support superspeed, this method should not be overridden

virtual IOReturn UIMCreateSSInterruptEndpoint( short functionAddress, short endpointNumber, UInt8 direction, short speed, UInt16 maxPacketSize, short pollingRate, UInt32 maxBurst);
Parameters
functionNumber

USB device ID of device

endpointNumber

endpoint address of the endpoint in the device

direction

Direction of data flow. kUSBIn or kUSBOut

speed

speed of the device kUSBDeviceSpeedFull, kUSBDeviceSpeedHigh, kUSBDeviceSpeedSuper

maxPacketSize

maximum packet size of this endpoint

pollingRate
maxBurst

number of extra packets in a burst transfer

UIMCreateSSIsochEndpoint

Create an endpoint in the controller with maxburst capabilities if controller does not support superspeed, this method should not be overridden

virtual IOReturn UIMCreateSSIsochEndpoint( short functionAddress, short endpointNumber, UInt32 maxPacketSize, UInt8 direction, UInt8 interval, UInt32 maxBurstAndMult);
Parameters
functionNumber

USB device ID of device

endpointNumber

endpoint address of the endpoint in the device

maxPacketSize

maximum packet size of this endpoint

direction

Direction of data flow. kUSBIn or kUSBOut

interval
maxBurstAndMult

number of extra packets in a burst transfer and burst multiplier

UIMCreateStreams

Create streams on an endpoint if controller does not support superspeed, this method should not be overridden

virtual IOReturn UIMCreateStreams( UInt8 functionNumber, UInt8 endpointNumber, UInt8 direction, UInt32 maxStream);
Parameters
functionNumber

USB device ID of device

endpointNumber

endpoint address of the endpoint in the device

direction

Direction of data flow. kUSBIn or kUSBOut

maxStreams

Number of streams to create

UIMDeviceToBeReset

Tell the UIM that the device will be reset.

virtual IOReturn UIMDeviceToBeReset( short functionAddress);
Parameters
functionAddress

USB device ID of device

Return Value

Return kIOReturnSuccess if pipes have been deleted and need to be setup again.

UIMMaxSupportedStream

UIM function Returns how many streams per endpoint are supported by the USB controller. This call does not go through the workloop gate.

virtual UInt32 UIMMaxSupportedStream( void);
Return Value

The number of streams per endpont that are supported by the USB controller. A value of 0 indicates that streams are not supported.

Write

virtual IOReturn Write( UInt32 streamID, IOMemoryDescriptor *buffer, USBDeviceAddress address, Endpoint *endpoint, IOUSBCompletion *completion, UInt32 noDataTimeout, UInt32 completionTimeout, IOByteCount reqCount );
Parameters
streamID

stream ID of the stream to write to

buffer

place to get the transferred data

address

Address of the device on the USB bus

endpoint

description of endpoint

completion

describes action to take when buffer has been emptied

noDataTimeout

number of milliseconds of no data movement before the request is aborted

completionTimeout

number of milliseonds after the command is on the bus in which it must complete

reqCount

number of bytes requested for the transfer (must not be greater than the length of the buffer)

Discussion

Write to a stream on a bulk endpoint