IOUSBController

Inherits from
IOUSBBus
Availability
Available in OS X v10.0 and later.
Declared in
IOUSBController.h

Overview

Base class for USB hardware driver

Not many directly useful methods for USB device driver writers, IOUSBDevice, IOUSBInterface and IOUSBPipe provide more useful abstractions. The bulk of this class interfaces between IOKit and the low-level UIM, which is based on the MacOS9 UIM. To impliment a new controller type, subclass IOUSBController and impiment all the "UIM functions". AppleUSBOHCI is an example of this implementing all the functions necessary to drive an OHCI controller.

Tasks

Miscellaneous

Instance Methods

abortPipe

virtual IOReturn AbortPipe( USBDeviceAddress address, Endpoint *endpoint );
Parameters
address

Address of the device on the USB bus

endpoint

description of endpoint

Discussion

Abort pending I/O to/from the specified endpoint, causing them to complete with return code kIOReturnAborted

AbortPipe

virtual IOReturn AbortPipe( USBDeviceAddress address, Endpoint *endpoint );
Parameters
address

Address of the device on the USB bus

endpoint

description of endpoint

Discussion

Abort pending I/O to/from the specified endpoint, causing them to complete with return code kIOReturnAborted

AcquireDeviceZero

virtual IOReturn AcquireDeviceZero( void );
Discussion

Get the device zero lock - call this before resetting a device, to ensure there's only one device with address 0

clearPipeStall

virtual IOReturn ClearPipeStall( USBDeviceAddress address, Endpoint *endpoint );
Parameters
address

Address of the device on the USB bus

endpoint

description of endpoint

Discussion

Clear a pipe stall.

ClearPipeStall

virtual IOReturn ClearPipeStall( USBDeviceAddress address, Endpoint *endpoint );
Parameters
address

Address of the device on the USB bus

endpoint

description of endpoint

Discussion

Clear a pipe stall.

ClearRootHubFeature

UIM function, set feature of root hub, As CLEAR_FEATURE control request.

virtual IOReturn ClearRootHubFeature( UInt16 wValue ) = 0;
Parameters
wValue

The feature to clear, as would be transferred in wValue field of SETUP packet.

ClearRootHubPortFeature(UInt16, UInt16)

UIM function, clear feature of a root hub port, As CLEAR_FEATURE control request to a port.

virtual IOReturn ClearRootHubPortFeature( UInt16 wValue, UInt16 port ) = 0;
Parameters
wValue

The feature to clear, as would be transferred in wValue field of SETUP packet.

port

Port to clear feature for

ClearRootHubPortFeature(UInt8 *, UInt16)

UIM function, Impliments GET_BUS_STATE control request, now obsolete.

virtual IOReturn GetRootHubPortState( UInt8 *state, UInt16 port ) = 0;

closePipe

virtual IOReturn ClosePipe( USBDeviceAddress address, Endpoint *endpoint );
Parameters
address

Address of the device on the USB bus

endpoint

description of endpoint

Discussion

Close a pipe to the specified device endpoint

ClosePipe

virtual IOReturn ClosePipe( USBDeviceAddress address, Endpoint *endpoint );
Parameters
address

Address of the device on the USB bus

endpoint

description of endpoint

Discussion

Close a pipe to the specified device endpoint

deviceRequest(IOUSBDevRequest *, IOUSBCompletion *, USBDeviceAddress, UInt8)

virtual IOReturn DeviceRequest( IOUSBDevRequest *request, IOUSBCompletion *completion, USBDeviceAddress address, UInt8 epNum );
Parameters
request

parameter block for the control request

completion

describes action to take when the request has been executed

address

Address of the device on the USB bus

epNum

endpoint number

Discussion

Make a control request to the specified endpoint There are two versions of this method, one uses a simple void * to point to the data portion of the transfer, the other uses an IOMemoryDescriptor to point to the data.

DeviceRequest(IOUSBDevRequest *, IOUSBCompletion *, USBDeviceAddress, UInt8)

virtual IOReturn DeviceRequest( IOUSBDevRequest *request, IOUSBCompletion *completion, USBDeviceAddress address, UInt8 epNum );
Parameters
request

parameter block for the control request

completion

describes action to take when the request has been executed

address

Address of the device on the USB bus

epNum

endpoint number

Discussion

Make a control request to the specified endpoint There are two versions of this method, one uses a simple void * to point to the data portion of the transfer, the other uses an IOMemoryDescriptor to point to the data.

deviceRequest(IOUSBDevRequest *, IOUSBCompletion *, USBDeviceAddress, UInt8, UInt32, UInt32)

virtual IOReturn DeviceRequest( IOUSBDevRequest *request, IOUSBCompletion *completion, USBDeviceAddress address, UInt8 epNum, UInt32 noDataTimeout, UInt32 completionTimeout );
Parameters
request

parameter block for the control request

completion

describes action to take when the request has been executed

address

Address of the device on the USB bus

epNum

endpoint number

Discussion

Make a control request to the specified endpoint There are two versions of this method, one uses a simple void * to point to the data portion of the transfer, the other uses an IOMemoryDescriptor to point to the data.

DeviceRequest(IOUSBDevRequest *, IOUSBCompletion *, USBDeviceAddress, UInt8, UInt32, UInt32)

virtual IOReturn DeviceRequest( IOUSBDevRequest *request, IOUSBCompletion *completion, USBDeviceAddress address, UInt8 epNum, UInt32 noDataTimeout, UInt32 completionTimeout );
Parameters
request

parameter block for the control request

completion

describes action to take when the request has been executed

address

Address of the device on the USB bus

epNum

endpoint number

Discussion

Make a control request to the specified endpoint There are two versions of this method, one uses a simple void * to point to the data portion of the transfer, the other uses an IOMemoryDescriptor to point to the data.

GetBandwidthAvailable

virtual UInt32 GetBandwidthAvailable( void ) = 0;
Return Value

maximum number of bytes that a new iso pipe could transfer per frame given current allocations.

Discussion

Returns the available bandwidth (in bytes) per frame or microframe for isochronous transfers.

GetFrameNumber

virtual UInt64 GetFrameNumber( void ) = 0;
Return Value

The frame number.

Discussion

Returns the full current frame number.

GetFrameNumber32

virtual UInt32 GetFrameNumber32( void ) = 0;
Return Value

The lsb 32 bits of the frame number.

Discussion

Returns the least significant 32 bits of the frame number.

GetRootHubConfDescriptor

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

virtual IOReturn GetRootHubConfDescriptor( OSData *desc ) = 0;
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 GetRootHubDescriptor( IOUSBHubDescriptor *desc ) = 0;
Parameters
desc

Descriptor structure to return data in

GetRootHubDeviceDescriptor

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

virtual IOReturn GetRootHubDeviceDescriptor( IOUSBDeviceDescriptor *desc ) = 0;
Parameters
desc

Descriptor structure to return data in

GetRootHubPortState

UIM function, Impliments GET_BUS_STATE control request, now obsolete.

virtual IOReturn GetRootHubPortState( UInt8 *state, UInt16 port ) = 0;

GetRootHubPortStatus

UIM function, get the status of a root hub port. As GET_STATUS control request to the port.

virtual IOReturn GetRootHubPortStatus( IOUSBHubPortStatus *status, UInt16 port ) = 0;
Parameters
status

Status structure to return

port

Port to get status for.

GetRootHubStatus

UIM function, get the status of the root hub. As GET_STATUS control request to device.

virtual IOReturn GetRootHubStatus( IOUSBHubStatus *status ) = 0;
Parameters
status

Status structure to return

isocIO

virtual IOReturn IsocIO( IOMemoryDescriptor *buffer, UInt64 frameStart, UInt32 numFrames, IOUSBIsocFrame *frameList, USBDeviceAddress address, Endpoint *endpoint, IOUSBIsocCompletion *completion );
Parameters
buffer

place to put the transferred data

frameStart

USB frame number of the frame to start transfer

numFrames

Number of frames to transfer

frameList

Bytes to transfer and result for each frame

address

Address of the device on the USB bus

endpoint

description of endpoint

completion

describes action to take when buffer has been filled

Discussion

Read from or write to an isochronous endpoint

IsocIO(IOMemoryDescriptor *, UInt64, UInt32, IOUSBIsocFrame *, USBDeviceAddress, Endpoint *, IOUSBIsocCompletion *)

virtual IOReturn IsocIO( IOMemoryDescriptor *buffer, UInt64 frameStart, UInt32 numFrames, IOUSBIsocFrame *frameList, USBDeviceAddress address, Endpoint *endpoint, IOUSBIsocCompletion *completion );
Parameters
buffer

place to put the transferred data

frameStart

USB frame number of the frame to start transfer

numFrames

Number of frames to transfer

frameList

Bytes to transfer and result for each frame

address

Address of the device on the USB bus

endpoint

description of endpoint

completion

describes action to take when buffer has been filled

Discussion

Read from or write to an isochronous endpoint

IsocIO(IOMemoryDescriptor *, UInt64, UInt32, IOUSBLowLatencyIsocFrame *, USBDeviceAddress, Endpoint *, IOUSBLowLatencyIsocCompletion *, UInt32)

virtual IOReturn IsocIO( IOMemoryDescriptor *buffer, UInt64 frameStart, UInt32 numFrames, IOUSBLowLatencyIsocFrame *frameList, USBDeviceAddress address, Endpoint *endpoint, IOUSBLowLatencyIsocCompletion *completion, UInt32 updateFrequency );
Parameters
buffer

place to put the transferred data

frameStart

USB frame number of the frame to start transfer

numFrames

Number of frames to transfer

frameList

Bytes to transfer and result for each frame

address

Address of the device on the USB bus

endpoint

description of endpoint

completion

describes action to take when buffer has been filled

updateFrequency

describes how often to update the framelist once the transfer has completed (in ms)

Discussion

Read from or write to an isochronous endpoint

openPipe

virtual IOReturn OpenPipe( USBDeviceAddress address, UInt8 speed, Endpoint *endpoint );
Parameters
address

Address of the device on the USB bus

speed

of the device: kUSBHighSpeed or kUSBLowSpeed

endpoint

description of endpoint to connect to

Discussion

Open a pipe to the specified device endpoint

OpenPipe

virtual IOReturn OpenPipe( USBDeviceAddress address, UInt8 speed, Endpoint *endpoint );
Parameters
address

Address of the device on the USB bus

speed

of the device: kUSBHighSpeed or kUSBLowSpeed

endpoint

description of endpoint to connect to

Discussion

Open a pipe to the specified device endpoint

Read

virtual IOReturn Read( IOMemoryDescriptor *buffer, USBDeviceAddress address, Endpoint *endpoint, IOUSBCompletion *completion, UInt32 noDataTimeout, UInt32 completionTimeout, IOByteCount reqCount );
Parameters
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 an interrupt or bulk endpoint

read(IOMemoryDescriptor *, USBDeviceAddress, Endpoint *, IOUSBCompletion *)

virtual IOReturn Read( IOMemoryDescriptor *buffer, USBDeviceAddress address, Endpoint *endpoint, IOUSBCompletion *completion );
Parameters
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

Discussion

Read from an interrupt or bulk endpoint

Read(IOMemoryDescriptor *, USBDeviceAddress, Endpoint *, IOUSBCompletion *)

virtual IOReturn Read( IOMemoryDescriptor *buffer, USBDeviceAddress address, Endpoint *endpoint, IOUSBCompletion *completion );
Parameters
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

Discussion

Read from an interrupt or bulk endpoint

read(IOMemoryDescriptor *, USBDeviceAddress, Endpoint *, IOUSBCompletion *, UInt32, UInt32)

virtual IOReturn Read( IOMemoryDescriptor *buffer, USBDeviceAddress address, Endpoint *endpoint, IOUSBCompletion *completion, UInt32 noDataTimeout, UInt32 completionTimeout );
Parameters
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

Discussion

Read from an interrupt or bulk endpoint

Read(IOMemoryDescriptor *, USBDeviceAddress, Endpoint *, IOUSBCompletion *, UInt32, UInt32)

virtual IOReturn Read( IOMemoryDescriptor *buffer, USBDeviceAddress address, Endpoint *endpoint, IOUSBCompletion *completion, UInt32 noDataTimeout, UInt32 completionTimeout );
Parameters
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

Discussion

Read from an interrupt or bulk endpoint

ReleaseDeviceZero

virtual void ReleaseDeviceZero( void );
Discussion

Release the device zero lock - call this to release the device zero lock, when there is no longer a device at address 0

resetPipe

virtual IOReturn ResetPipe( USBDeviceAddress address, Endpoint *endpoint );
Parameters
address

Address of the device on the USB bus

endpoint

description of endpoint

Discussion

Abort pending I/O and clear stalled state - this method is a combination of abortPipe and clearPipeStall

ResetPipe

virtual IOReturn ResetPipe( USBDeviceAddress address, Endpoint *endpoint );
Parameters
address

Address of the device on the USB bus

endpoint

description of endpoint

Discussion

Abort pending I/O and clear stalled state - this method is a combination of abortPipe and clearPipeStall

SetHubAddress

UIM function, set the address of the simulated root hub device, as SET_ADDRESS

virtual IOReturn SetHubAddress( UInt16 wValue ) = 0;
Parameters
wValue

New address for root hub.

SetRootHubDescriptor

UIM function, optional. Set the hub descriptor data. As SET_DESCRIPTOR control request for hub descrptor

virtual IOReturn SetRootHubDescriptor( OSData *buffer ) = 0;
Parameters
buffer

Descriptor data

SetRootHubFeature

UIM function, set feature of root hub, As SET_FEATURE control request.

virtual IOReturn SetRootHubFeature( UInt16 wValue ) = 0;
Parameters
wValue

The feature to set, as would be transferred in wValue field of SETUP packet.

SetRootHubPortFeature

UIM function, set feature of a root hub port, As SET_FEATURE control request to a port.

virtual IOReturn SetRootHubPortFeature( UInt16 wValue, UInt16 port ) = 0;
Parameters
wValue

The feature to set, as would be transferred in wValue field of SETUP packet.

port

Port to set feature for

UIMAbortEndpoint

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

virtual IOReturn UIMAbortEndpoint( short functionNumber, short endpointNumber, short direction) = 0;
Parameters
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.

UIMClearEndpointStall

UIM function Clear stall on the specified endpoint, set data toggle to zero, return all transactions queued on it.

virtual IOReturn UIMClearEndpointStall( short functionNumber, short endpointNumber, short direction) = 0;
Parameters
functionNumber

The USB device ID of the device to Clear

endpointNumber

The endpoint number to Clear

direction

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

UIMCreateBulkEndpoint

UIM function, create a bulk endpoint for the controller.

virtual IOReturn UIMCreateBulkEndpoint( UInt8 functionNumber, UInt8 endpointNumber, UInt8 direction, UInt8 speed, UInt8 maxPacketSize) = 0;
Parameters
functionNumber

The USB device ID of the device for this endpoint

endpointNumber

The endpoint number for this endpoint

direction

Specifies direction for the endpoint. kUSBIn or KUSBOut.

speed

speed of the device: kUSBDeviceSpeedLow or kUSBDeviceSpeedFull

maxPacketSize

Maximum packet size of this endpoint

UIMCreateBulkTransfer

UIM function, Do a transfer on a bulk endpoint. This method supercedes the method which takes multiple parameters.

virtual IOReturn UIMCreateBulkTransfer( IOUSBCommand *command);
Parameters
command

paramters for transfer.

UIMCreateControlEndpoint

UIM function, create a control endpoint for the controller.

virtual IOReturn UIMCreateControlEndpoint( UInt8 functionNumber, UInt8 endpointNumber, UInt16 maxPacketSize, UInt8 speed) = 0;
Parameters
functionNumber

The USB device ID of the device for this endpoint

endpointNumber

The endpoint number for this endpoint

maxPacketSize

Maximum packet size of this endpoint

speed

speed of the device: kUSBDeviceSpeedLow or kUSBDeviceSpeedFull

UIMCreateControlTransfer

UIM function, Do a transfer on a control endpoint. This method supercedes the method which takes a void * parameter.

virtual IOReturn UIMCreateControlTransfer( short functionNumber, short endpointNumber, IOUSBCompletion completion, IOMemoryDescriptor *CBP, bool bufferRounding, UInt32 bufferSize, short direction) = 0;
Parameters
functionNumber

The USB device ID of the device to perform the transaction with

endpointNumber

The endpoint number for the transaction

completion

Action to perform when I/O completes

CBP

Memory descriptor describing the buffer to transfer. Will never describe memory which has disjoint packets.

bufferRounding

If true, short packets are OK and do not cause an error

bufferSize

Size of the data to transfer in the data phase. (C

direction

Specifies direction and PID for transaction. kUSBIn, KUSBOut (DATA PID) or kUSBSetup (SETUP PID).

UIMCreateInterruptEndpoint

UIM function, create an interrupt endpoint for the controller.

virtual IOReturn UIMCreateInterruptEndpoint( short functionAddress, short endpointNumber, UInt8 direction, short speed, UInt16 maxPacketSize, short pollingRate) = 0;
Parameters
functionNumber

The USB device ID of the device for this endpoint

endpointNumber

The endpoint number for this endpoint

direction

Specifies direction for the endpoint. kUSBIn or KUSBOut.

speed

speed of the device: kUSBDeviceSpeedLow or kUSBDeviceSpeedFull

maxPacketSize

Maximum packet size of this endpoint

pollingRate

The maximum polling interval from the endpoint descriptor.

UIMCreateInterruptTransfer

UIM function, Do a transfer on an interrupt endpoint. This method supercedes the method which takes multiple parameters.

virtual IOReturn UIMCreateInterruptTransfer( IOUSBCommand *command);
Parameters
command

paramters for transfer.

UIMCreateIsochEndpoint

Create an Isochronous endpoint in the controller.

virtual IOReturn UIMCreateIsochEndpoint( short functionAddress, short endpointNumber, UInt32 maxPacketSize, UInt8 direction) = 0;
Parameters
functionNumber

The USB device ID of the device for this endpoint

endpointNumber

The endpoint number for this endpoint

maxPacketSize

Maximum packet size of this endpoint

direction

Specifies direction for the endpoint. kUSBIn or KUSBOut.

UIMCreateIsochTransfer

UIM function, Do a transfer on an Isocchronous endpoint.

virtual IOReturn UIMCreateIsochTransfer( IOUSBIsocCommand *command);
Parameters
command

an IOUSBIsocCommand object with all the necessary information

UIMCreateIsochTransfer(short, short, IOUSBIsocCompletion, UInt8, UInt64, IOMemoryDescriptor *, UInt32, IOUSBIsocFrame *)

UIM function, Do a transfer on an Isocchronous endpoint.

virtual IOReturn UIMCreateIsochTransfer( short functionAddress, short endpointNumber, IOUSBIsocCompletion completion, UInt8 direction, UInt64 frameStart, IOMemoryDescriptor *pBuffer, UInt32 frameCount, IOUSBIsocFrame *pFrames) = 0;
Parameters
functionNumber

The USB device ID of the device to perform the transaction with

endpointNumber

The endpoint number for the transaction

completion

Action to perform when I/O completes

direction

Specifies direction for transfer. kUSBIn or KUSBOut.

frameStart

The frame number in which to start the transactions

pBuffer

describes memory buffer.

frameCount

number of frames to do transactions in

pFrames

Describes transactions in individual frames, gives sizes and reults for transactions.

UIMCreateIsochTransfer(short, short, IOUSBIsocCompletion, UInt8, UInt64, IOMemoryDescriptor *, UInt32, IOUSBLowLatencyIsocFrame *, UInt32)

UIM function, Do a transfer on an Isocchronous endpoint.

virtual IOReturn UIMCreateIsochTransfer( short functionAddress, short endpointNumber, IOUSBIsocCompletion completion, UInt8 direction, UInt64 frameStart, IOMemoryDescriptor *pBuffer, UInt32 frameCount, IOUSBLowLatencyIsocFrame *pFrames, UInt32 updateFrequency);
Parameters
functionNumber

The USB device ID of the device to perform the transaction with

endpointNumber

The endpoint number for the transaction

completion

Action to perform when I/O completes

direction

Specifies direction for transfer. kUSBIn or KUSBOut.

frameStart

The frame number in which to start the transactions

pBuffer

describes memory buffer.

frameCount

number of frames to do transactions in

pFrames

Describes transactions in individual frames, gives sizes and reults for transactions.

updateFrequency

Describes how often we update the frameList parameters (in ms)

UIMDeleteEndpoint

UIM function Delete the specified endpoint, returning all transactions queued on it.

virtual IOReturn UIMDeleteEndpoint( short functionNumber, short endpointNumber, short direction) = 0;
Parameters
functionNumber

The USB device ID of the device to Delete

endpointNumber

The endpoint number to Delete

direction

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

UIMFinalize

UIM function, finalise the controller and UIM data structures prior to removal.

virtual IOReturn UIMFinalize() = 0;

UIMInitialize

UIM function, initialise the controller and UIM data structures.

virtual IOReturn UIMInitialize( IOService *provider ) = 0;

UIMRootHubStatusChange()

UIM function UIMRootHubStatusChange - This method was internal to the UIM (never called by the superclass) until IOUSBControllerV3. For UIMs which are a subclass of IOUSBController or IOUSBControllerV2, it can still be used internally only. For subclasses of IOUSBControllerV3, however, the meaning has changed slightly. Now, it is used to determine if there is a status change on the root hub, and if so, it needs to update the IOUSBControllerV3 instance variable _rootHubStatusChangedBitmap

virtual void UIMRootHubStatusChange( void) = 0;

UIMRootHubStatusChange(bool)

UIM function UIMRootHubStatusChange(bool) - This method was internal to the UIM (never called by the superclass) until IOUSBControllerV3. For UIMs which are a subclass of IOUSBController or IOUSBControllerV2, it can still be used internally only. For subclasses of IOUSBControllerV3, however, it has become obsolete (it still needs to be implemented since it is pure virtual)

virtual void UIMRootHubStatusChange( bool abort ) = 0;

UIMRootHubStatusChange(bool)(bool)

UIM function UIMRootHubStatusChange(bool) - This method was internal to the UIM (never called by the superclass) until IOUSBControllerV3. For UIMs which are a subclass of IOUSBController or IOUSBControllerV2, it can still be used internally only. For subclasses of IOUSBControllerV3, however, it has become obsolete (it still needs to be implemented since it is pure virtual)

virtual void UIMRootHubStatusChange( bool abort ) = 0;

Write

virtual IOReturn Write( IOMemoryDescriptor *buffer, USBDeviceAddress address, Endpoint *endpoint, IOUSBCompletion *completion, UInt32 noDataTimeout, UInt32 completionTimeout, IOByteCount reqCount );
Parameters
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 an interrupt or bulk endpoint

write(IOMemoryDescriptor *, USBDeviceAddress, Endpoint *, IOUSBCompletion *)

virtual IOReturn Write( IOMemoryDescriptor *buffer, USBDeviceAddress address, Endpoint *endpoint, IOUSBCompletion *completion );
Parameters
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

Discussion

Write to an interrupt or bulk endpoint

Write(IOMemoryDescriptor *, USBDeviceAddress, Endpoint *, IOUSBCompletion *)

virtual IOReturn Write( IOMemoryDescriptor *buffer, USBDeviceAddress address, Endpoint *endpoint, IOUSBCompletion *completion );
Parameters
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

Discussion

Write to an interrupt or bulk endpoint

write(IOMemoryDescriptor *, USBDeviceAddress, Endpoint *, IOUSBCompletion *, UInt32, UInt32)

virtual IOReturn Write( IOMemoryDescriptor *buffer, USBDeviceAddress address, Endpoint *endpoint, IOUSBCompletion *completion, UInt32 noDataTimeout, UInt32 completionTimeout );
Parameters
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

Discussion

Write to an interrupt or bulk endpoint

Write(IOMemoryDescriptor *, USBDeviceAddress, Endpoint *, IOUSBCompletion *, UInt32, UInt32)

virtual IOReturn Write( IOMemoryDescriptor *buffer, USBDeviceAddress address, Endpoint *endpoint, IOUSBCompletion *completion, UInt32 noDataTimeout, UInt32 completionTimeout );
Parameters
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

Discussion

Write to an interrupt or bulk endpoint

Endpoint

struct Endpoint {
   IOUSBEndpointDescriptor *descriptor;
   UInt8 number;
   UInt8 direction; // in, out
   UInt8 transferType; // cntrl, bulk, isoc, int
   UInt16 maxPacketSize; // MPS (includes the multiplier for HS High Bandwidth Isoch endpoints)
   UInt8 interval;
};
Fields
descriptor

The raw endpoint descriptor.

number

Endpoint number

direction

Endpoint direction: kUSBOut, kUSBIn, kUSBAnyDirn

transferType

Type of endpoint: kUSBControl, kUSBIsoc, kUSBBulk, kUSBInterrupt

maxPacketSize

Maximum packet size for endpoint, which will include the multiplier for HS High Bandwidth endpoints

interval

Polling interval in milliseconds (only relevent for Interrupt endpoints)

Discussion

Describes an endpoint of a device. Simply an easier to use version of the endpoint descriptor.