public:
virtual IOReturn AcquireDeviceZero();
Get the device zero lock - call this before resetting a device, to ensure there's only one device with address 0
public:
IOReturn ConfigureDeviceZero(UInt8 maxPacketSize, UInt8 speed);
create a pipe to the default pipe for the device at address 0
Name Description maxPacketSize max packet size for the pipe speed Device speed
public:
virtual UInt32 GetBandwidthAvailable() = 0;
Returns the available bandwidth (in bytes) per frame for isochronous transfers.
Result: maximum number of bytes that a new iso pipe could transfer per frame given current allocations.public:
IOReturn GetDeviceZeroDescriptor(IOUSBDeviceDescriptor *desc);
read the device descriptor of the device at address 0
Name Description desc pointer to descriptor
public:
virtual UInt64 GetFrameNumber() = 0;
Returns the full current frame number.
Result: The frame number.public:
virtual UInt32 GetFrameNumber32() = 0;
Returns the least significant 32 bits of the frame number.
Result: The lsb 32 bits of the frame number.public:
IOUSBDevice *MakeDevice(IOUSBDeviceDescriptor *desc, UInt8 speed, UInt32 power);
Create a new device object for the device currently at address 0. This routine calls SetDeviceZeroAddress() with a new, unique, address for the device and adds the device into the registry.
Result: Pointer to the newly-created device, 0 if the object coudn't be created.
Name Description desc Device descriptor of the device speed Device speed power Bus power available to the device
public:
virtual void ReleaseDeviceZero(void);
Release the device zero lock - call this to release the device zero lock, when there is no longer a device at address 0
public:
IOReturn SetDeviceZeroAddress(USBDeviceAddress address, UInt8 maxPacketSize, UInt8 speed);
Set the device address of the device currently at address 0. When this routine returns, it's safe to release the device zero lock.
Name Description address New address for the device maxPacketSize maximum packet size for the default pipe speed speed of the device
public:
void WaitForReleaseDeviceZero();
Block until the device zero lock is released
public:
virtual IOReturn abortPipe(USBDeviceAddress address, Endpoint * endpoint);
Abort pending I/O to/from the specified endpoint, causing them to complete with return code kIOReturnAborted
Name Description address Address of the device on the USB bus endpoint description of endpoint
public:
virtual IOReturn clearPipeStall(USBDeviceAddress address, Endpoint * endpoint);
Clear a pipe stall.
Name Description address Address of the device on the USB bus endpoint description of endpoint
public:
virtual IOReturn closePipe(USBDeviceAddress address, Endpoint * endpoint);
Close a pipe to the specified device endpoint
Name Description address Address of the device on the USB bus endpoint description of endpoint
public:
virtual IOReturn deviceRequest(IOUSBDevRequest * request, IOUSBCompletion * completion, USBDeviceAddress address, UInt8 epNum);
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.
Name Description 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
public:
virtual IOReturn isocIO(IOMemoryDescriptor * buffer, UInt64 frameStart, UInt32 numFrames, IOUSBIsocFrame *frameList, USBDeviceAddress address, Endpoint * endpoint, IOUSBIsocCompletion * completion);
Read from or write to an isochronous endpoint
Name Description 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
public:
virtual IOReturn openPipe(USBDeviceAddress address, UInt8 speed, Endpoint *endpoint);
Open a pipe to the specified device endpoint
Name Description address Address of the device on the USB bus speed of the device: kUSBHighSpeed or kUSBLowSpeed endpoint description of endpoint to connect to
public:
virtual IOReturn read(IOMemoryDescriptor * buffer, USBDeviceAddress address, Endpoint * endpoint, IOUSBCompletion * completion);
Read from an interrupt or bulk endpoint
Name Description 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
public:
virtual IOReturn resetPipe(USBDeviceAddress address, Endpoint * endpoint);
Abort pending I/O and clear stalled state - this method is a combination of abortPipe and clearPipeStall
Name Description address Address of the device on the USB bus endpoint description of endpoint
public:
virtual IOReturn write(IOMemoryDescriptor * buffer, USBDeviceAddress address, Endpoint * endpoint, IOUSBCompletion * completion);
Write to an interrupt or bulk endpoint
Name Description 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
public:struct Endpoint { IOUSBEndpointDescriptor *descriptor; UInt8 number; UInt8 direction; // in, out UInt8 transferType; // cntrl, bulk, isoc, int UInt16 maxPacketSize; UInt8 interval; };
Describes an endpoint of a device. Simply an easier to use version of the endpoint descriptor.
Name Description 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 interval Polling interval in milliseconds (only relevent for Interrupt endpoints)
© 2000 Apple Computer, Inc. (Last Updated 2/23/2000)