2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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.
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
20 * @APPLE_LICENSE_HEADER_END@
23 #include <IOKit/assert.h>
24 #include <IOKit/ps2/ApplePS2MouseDevice.h>
25 #include "ApplePS2Controller.h"
27 // =============================================================================
28 // ApplePS2MouseDevice Class Implementation
31 #define super IOService
32 OSDefineMetaClassAndStructors(ApplePS2MouseDevice
, IOService
);
34 bool ApplePS2MouseDevice::attach(IOService
* provider
)
36 if( !super::attach(provider
) ) return false;
38 assert(_controller
== 0);
39 _controller
= (ApplePS2Controller
*)provider
;
40 _controller
->retain();
45 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
47 void ApplePS2MouseDevice::detach( IOService
* provider
)
49 assert(_controller
== provider
);
50 _controller
->release();
53 super::detach(provider
);
56 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
58 void ApplePS2MouseDevice::installInterruptAction(OSObject
* target
,
59 PS2InterruptAction action
)
61 _controller
->installInterruptAction(kDT_Mouse
, target
, action
);
64 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
66 void ApplePS2MouseDevice::uninstallInterruptAction()
68 _controller
->uninstallInterruptAction(kDT_Mouse
);
71 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
73 PS2Request
* ApplePS2MouseDevice::allocateRequest()
75 return _controller
->allocateRequest();
78 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
80 void ApplePS2MouseDevice::freeRequest(PS2Request
* request
)
82 _controller
->freeRequest(request
);
85 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
87 bool ApplePS2MouseDevice::submitRequest(PS2Request
* request
)
89 return _controller
->submitRequest(request
);
92 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
94 void ApplePS2MouseDevice::submitRequestAndBlock(PS2Request
* request
)
96 _controller
->submitRequestAndBlock(request
);