Difference between revisions of "IOUSBDeviceFamily"

From iPhone Development Wiki
Jump to: navigation, search
m (IOUSBDeviceLib)
Line 19: Line 19:
 
| 5 || setProtocolForAlternateSetting || uint8_t ''protocol'', uint8_t ''_unused'' || -
 
| 5 || setProtocolForAlternateSetting || uint8_t ''protocol'', uint8_t ''_unused'' || -
 
|-
 
|-
| 6 || appendStandardClassOrVendorDescriptor || ? || -
+
| 6 || appendStandardClassOrVendorDescriptor || unsigned long ''?'', unsigned long ''flags''; uint8_t ''descriptor''[*] || -
 
|-
 
|-
| 7 || appendNonStandardClassOrVendorDescriptor || ? || -
+
| 7 || appendNonStandardClassOrVendorDescriptor || unsigned long ''?'', unsigned long ''flags''; uint8_t ''descriptor''[*] || -
 
|-
 
|-
| 8 || setClassCommandCallbacks || ? || -
+
| 8 || setClassCommandCallbacks (async) || bool ''wakeOnRequest'', bool ''hasCallback2'' || -
 
|-
 
|-
| 9 || classCommandCallbacksHandler || ? || -
+
| 9 || ? || bool ''hasRequestCallback'', size_t ''dataLength'', uint64_t ''mapToken'', int64_t ''status'' || -
 
|-
 
|-
| 10 || createPipe || int ''?'', int ''?'', int ''?'', int ''?'', int ''?'', int ''?'' || void* ''pipe''
+
| 10 || createPipe || int ''type'', int ''direction'', int ''maxPacketSize'', int ''?'', int ''?'', int ''?'' || void* ''pipe''
 
|-
 
|-
 
| 11 || commitConfiguration || - || -
 
| 11 || commitConfiguration || - || -
Line 33: Line 33:
 
| 12 || setAlternateSetting || uint8_t ''configIndex'' || -
 
| 12 || setAlternateSetting || uint8_t ''configIndex'' || -
 
|-
 
|-
| 13 || readPipe || ? || ?
+
| 13 || readPipe || void* ''pipe'', uint64_t ''mapToken'', long ''length'' || long ''length''
 
|-
 
|-
 
| 14 || writePipe || ? || ?
 
| 14 || writePipe || ? || ?
Line 43: Line 43:
 
| 17 || getPipeCurrentMaxPacketSize || void* ''pipe'' || int ''packetSize''
 
| 17 || getPipeCurrentMaxPacketSize || void* ''pipe'' || int ''packetSize''
 
|-
 
|-
| 18 || createData || ? || ?
+
| 18 || createData || int64_t ''length'' || uint8_t* ''dataPtr'', int ''capacity'', uint64_t ''mapToken''
 
|-
 
|-
 
| 19 || releaseDataCallback || ? || -
 
| 19 || releaseDataCallback || ? || -
Line 50: Line 50:
 
|-
 
|-
 
|}
 
|}
 +
 +
To use setClassCommandCallbacks, you must issue the call asynchronously, and put the callback function in its ''reference'' argument, e.g.
 +
 +
<source lang="c">
 +
void callback(void* refcon, IOReturn result, size_t* arguments) {
 +
    ...
 +
}
 +
 +
uint64_t refs[3];
 +
refs[1] = (uint64_t) callback;
 +
refs[2] = (uint64_t) refcon;
 +
IOConnectCallAsyncMethod(connection, 8, wakePort, refs, 3, ...);
 +
</source>
  
 
== IOUSBDeviceLib ==
 
== IOUSBDeviceLib ==

Revision as of 20:16, 24 December 2010

IOUSBDeviceFamily is a kernel-extension for communication of device to the host via the USB cable. This is only an abstract extension. The actual driver implementation is in AppleSynopsysOTG2.

Methods

Selector Action Input Output
0 open void* _arg -
1 close - -
2 setDescription char description[*] -
3 setClassForAlternateSetting uint8_t class_, uint8_t _unused -
4 setSubClassForAlternateSetting uint8_t subclass, uint8_t _unused -
5 setProtocolForAlternateSetting uint8_t protocol, uint8_t _unused -
6 appendStandardClassOrVendorDescriptor unsigned long ?, unsigned long flags; uint8_t descriptor[*] -
7 appendNonStandardClassOrVendorDescriptor unsigned long ?, unsigned long flags; uint8_t descriptor[*] -
8 setClassCommandCallbacks (async) bool wakeOnRequest, bool hasCallback2 -
9 ? bool hasRequestCallback, size_t dataLength, uint64_t mapToken, int64_t status -
10 createPipe int type, int direction, int maxPacketSize, int ?, int ?, int ? void* pipe
11 commitConfiguration - -
12 setAlternateSetting uint8_t configIndex -
13 readPipe void* pipe, uint64_t mapToken, long length long length
14 writePipe ? ?
15 stallPipe void* pipe -
16 abortPipe void* pipe -
17 getPipeCurrentMaxPacketSize void* pipe int packetSize
18 createData int64_t length uint8_t* dataPtr, int capacity, uint64_t mapToken
19 releaseDataCallback ? -
20 isActivated - bool ? , bool ?

To use setClassCommandCallbacks, you must issue the call asynchronously, and put the callback function in its reference argument, e.g.

void callback(void* refcon, IOReturn result, size_t* arguments) {
    ...
}

uint64_t refs[3];
refs[1] = (uint64_t) callback;
refs[2] = (uint64_t) refcon;
IOConnectCallAsyncMethod(connection, 8, wakePort, refs, 3, ...);

IOUSBDeviceLib

IOUSBDeviceLib is a userland COM plug-in for accessing the IOUSBDeviceInterface. The plug-in's UUID is {9E72217E-8A60-11DB-BF57-000D936D06D2}, and its interface's UUID is {EA33BA4F-8A60-11DB-84DB-000D936D06D2}.