Root/
Source at commit 1146 created 12 years 11 months ago. By azimutz, Sync with trunk (r1145). Add nVidia dev id's, 0DF4 for "GeForce GT 450M" (issue 99) and 1251 for "GeForce GTX 560M" (thanks to oSxFr33k for testing). | |
---|---|
1 | /*␊ |
2 | * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved.␊ |
3 | *␊ |
4 | * @APPLE_LICENSE_HEADER_START@␊ |
5 | * ␊ |
6 | * The contents of this file constitute Original Code as defined in and␊ |
7 | * are subject to the Apple Public Source License Version 1.1 (the␊ |
8 | * "License"). You may not use this file except in compliance with the␊ |
9 | * License. Please obtain a copy of the License at␊ |
10 | * http://www.apple.com/publicsource and read it before using this file.␊ |
11 | * ␊ |
12 | * This Original Code and all software distributed under the License are␊ |
13 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER␊ |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,␊ |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,␊ |
16 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the␊ |
17 | * License for the specific language governing rights and limitations␊ |
18 | * under the License.␊ |
19 | * ␊ |
20 | * @APPLE_LICENSE_HEADER_END@␊ |
21 | */␊ |
22 | ␊ |
23 | #ifndef _IOKIT_IOFIREWIREIRMALLOCATION_H␊ |
24 | #define _IOKIT_IOFIREWIREIRMALLOCATION_H␊ |
25 | ␊ |
26 | #include <libkern/c++/OSObject.h>␊ |
27 | ␊ |
28 | class IOFireWireController;␊ |
29 | ␊ |
30 | //#include <IOKit/firewire/IOFireWireController.h>␊ |
31 | //#include <IOKit/firewire/IOFireWireFamilyCommon.h>␊ |
32 | ␊ |
33 | /*! @class IOFireWireIRMAllocation␊ |
34 | */␊ |
35 | ␊ |
36 | class IOFireWireIRMAllocation : public OSObject␊ |
37 | {␊ |
38 | ␉friend class IOFireWireController;␊ |
39 | ␊ |
40 | OSDeclareDefaultStructors(IOFireWireIRMAllocation)␊ |
41 | ␉␊ |
42 | public:␊ |
43 | ␉␉␊ |
44 | ␉␉// Prototype for the callback if reallocation after bus-reset is unsuccessful.␊ |
45 | ␉␉typedef IOReturn (*AllocationLostNotificationProc)(void* refCon, class IOFireWireIRMAllocation* allocation);␊ |
46 | ␊ |
47 | ␉// Initialize the IRM allocation object. ␊ |
48 | virtual bool init( IOFireWireController * control,␊ |
49 | ␉␉␉␉␉ Boolean releaseIRMResourcesOnFree = true, ␊ |
50 | ␉␉␉␉␉ AllocationLostNotificationProc allocationLostProc = NULL,␊ |
51 | ␉␉␉␉␉ void *pLostProcRefCon = NULL);␊ |
52 | ␉␊ |
53 | ␉// Specify whether of not the IRM resources should automatically␊ |
54 | ␉// be released when freeing this allocation object.␊ |
55 | ␉virtual void setReleaseIRMResourcesOnFree(Boolean doRelease);␊ |
56 | ␉␊ |
57 | ␉// Use the IRMAllocation object to allocate isoch resources␊ |
58 | ␉virtual IOReturn allocateIsochResources(UInt8 isochChannel, UInt32 bandwidthUnits);␊ |
59 | ␊ |
60 | ␉// Free isoch resources previously allocated with a call to allocateIsochResources␊ |
61 | ␉virtual IOReturn deallocateIsochResources(void);␊ |
62 | ␉␊ |
63 | ␉// Returns true if isoch resources are currently allocated, and if true, the allocated channel, and amount of isoch bandwidth.␊ |
64 | ␉virtual Boolean areIsochResourcesAllocated(UInt8 *pAllocatedIsochChannel, UInt32 *pAllocatedBandwidthUnits);␊ |
65 | ␉␊ |
66 | ␉// Get the refcon␊ |
67 | ␉virtual void * GetRefCon(void);␊ |
68 | ␉virtual void SetRefCon(void* refCon); ␊ |
69 | ␊ |
70 | ␉// Override the base-class release function for special processing␊ |
71 | ␉virtual void release() const;␊ |
72 | ␉␊ |
73 | protected:␊ |
74 | ␊ |
75 | ␉␉/*! @struct ExpansionData␊ |
76 | ␉␉@discussion This structure will be used to expand the capablilties of the class in the future.␊ |
77 | ␉␉*/ ␊ |
78 | ␉␉struct ExpansionData { };␊ |
79 | ␉␊ |
80 | ␉␉/*! @var reserved␊ |
81 | ␉␉Reserved for future use. (Internal use only) */␊ |
82 | ␉␉ExpansionData *reserved;␊ |
83 | ␊ |
84 | ␉␉// Free the allocation object (and release IRM resources if needed)␊ |
85 | ␉␉virtual void free( void );␊ |
86 | ␊ |
87 | ␉␉// Controller will call this to notify about bus-reset complete.␊ |
88 | ␉␉virtual void handleBusReset(UInt32 generation);␊ |
89 | ␉␊ |
90 | ␉␉virtual void failedToRealloc(void);␊ |
91 | ␉␉virtual UInt32 getAllocationGeneration(void);␊ |
92 | ␉␉static void threadFunc( void * arg );␊ |
93 | ␊ |
94 | private:␊ |
95 | ␉␊ |
96 | ␉AllocationLostNotificationProc fAllocationLostProc;␊ |
97 | ␉void *fLostProcRefCon;␊ |
98 | ␉Boolean fReleaseIRMResourcesOnFree;␊ |
99 | ␉UInt8 fIsochChannel; ␊ |
100 | ␉UInt32 fBandwidthUnits;␊ |
101 | ␉UInt32 fAllocationGeneration;␊ |
102 | ␉IORecursiveLock *fLock ;␊ |
103 | ␉IOFireWireController *fControl;␊ |
104 | ␉Boolean isAllocated;␊ |
105 | ␉␊ |
106 | ␉OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 0);␊ |
107 | ␉OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 1);␊ |
108 | ␉OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 2);␊ |
109 | ␉OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 3);␊ |
110 | ␉OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 4);␊ |
111 | ␉OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 5);␊ |
112 | ␉OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 6);␊ |
113 | ␉OSMetaClassDeclareReservedUnused(IOFireWireIRMAllocation, 7);␊ |
114 | };␊ |
115 | ␊ |
116 | #endif // _IOKIT_IOFIREWIREIRMALLOCATION_H␊ |
117 |