|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. ! 3: * ! 4: * @APPLE_LICENSE_HEADER_START@ ! 5: * ! 6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights ! 7: * Reserved. This file contains Original Code and/or Modifications of ! 8: * Original Code as defined in and that are subject to the Apple Public ! 9: * Source License Version 1.1 (the "License"). You may not use this file ! 10: * except in compliance with the License. Please obtain a copy of the ! 11: * License at http://www.apple.com/publicsource and read it before using ! 12: * this file. ! 13: * ! 14: * The Original Code and all software distributed under the License are ! 15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER ! 16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, ! 17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, ! 18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the ! 19: * License for the specific language governing rights and limitations ! 20: * under the License. ! 21: * ! 22: * @APPLE_LICENSE_HEADER_END@ ! 23: */ ! 24: ! 25: /* ! 26: File: MouseModule.h ! 27: ! 28: Contains: Header file for mouse module ! 29: ! 30: Version: xxx put version here xxx ! 31: ! 32: Copyright: � 1997-1998 by Apple Computer, Inc., all rights reserved. ! 33: ! 34: File Ownership: ! 35: ! 36: DRI: Craig Keithley ! 37: ! 38: Other Contact: xxx put other contact here xxx ! 39: ! 40: Technology: xxx put technology here xxx ! 41: ! 42: Writers: ! 43: ! 44: (BWS) Brent Schorsch ! 45: (CJK) Craig Keithley ! 46: ! 47: Change History (most recent first): ! 48: ! 49: <USB23> 6/18/98 BWS fixed interrupt refcon support ! 50: <USB22> 6/18/98 CJK change retry to 3. add refcon to mouse data struct ! 51: <USB21> 6/16/98 CJK change FindHIDInterfaceByProtocol to FindHIDInterfaceByNumber ! 52: <USB20> 6/11/98 CJK Remove driverentry routine (not needed or used). ! 53: <USB19> 6/8/98 CJK change SetParamBlock function name to InitParamBlock. Remove ! 54: unneeded xxget... functions ! 55: <USB18> 5/26/98 CJK add prototype for SetParamBlock ! 56: <USB17> 5/15/98 CJK Increase size of HID Report. ! 57: <USB16> 5/4/98 CJK add IntRead req count setup field ! 58: <USB15> 4/26/98 CJK add setidle back in. This seems to solve periodic stall ! 59: problems. ! 60: <USB14> 4/26/98 CJK increase retry count to 10 ! 61: <USB13> 4/24/98 CJK Change cursor device field name in mouse data structure to be ! 62: "CursorDeviceInfo" ! 63: <USB12> 4/23/98 CJK update to new style of setting bmRequest ! 64: <USB11> 4/9/98 CJK remove include of USBClassDrivers.h, USBHIDModules.h, and ! 65: USBDeviceDefines.h ! 66: <10> 4/8/98 CJK add saved interrupt routine proc pointer ! 67: <9> 3/26/98 CJK fix delay callback depth problem ! 68: <8> 3/25/98 CJK add interrupt states to enum ! 69: <7> 3/17/98 CJK Remove comma from last enum item. Update function prototypes ! 70: using extractprototypes tool. ! 71: <6> 3/2/98 CJK Add include of USBHIDModules.h. Remove include of HIDEmulation.h ! 72: <5> 2/18/98 CJK Add cursor device structure ! 73: <4> 2/11/98 CJK remove unneeded state values. ! 74: <3> 2/9/98 CJK Change Interface Descriptor field in mouse paramblock to be just ! 75: a single interface. ! 76: <2> 2/9/98 CJK Add InterfaceEntry function prototype ! 77: <1> 12/17/97 CJK First time checkin ! 78: */ ! 79: #ifndef __MouseModuleH__ ! 80: #define __MouseModuleH__ ! 81: ! 82: //#include <Types.h> ! 83: //#include <Devices.h> ! 84: #include "../driverservices.h" ! 85: //#include <Processes.h> ! 86: #include "CursorDevices.h" ! 87: #include "../USB.h" ! 88: ! 89: Boolean immediateError(OSStatus err); ! 90: void MouseModuleInitiateTransaction(USBPB *pb); ! 91: void MouseModuleDelayCompletionProc(USBPB *pb); ! 92: void TransactionCompletionProc(USBPB *pb); ! 93: void InterfaceEntry(UInt32 interfacenum, USBInterfaceDescriptorPtr pInterfaceDescriptor, USBDeviceDescriptorPtr pDeviceDescriptor, USBDeviceRef device); ! 94: ! 95: /* Prototypes from MouseModuleHeader.c Tue, Mar 17, 1998 3:30:22 PM */ ! 96: static OSStatus MouseModuleInitialize(USBDeviceRef device, USBDeviceDescriptorPtr pDesc, UInt32 busPowerAvailable); ! 97: static OSStatus MouseInterfaceInitialize(UInt32 interfacenum, USBInterfaceDescriptorPtr pInterface, USBDeviceDescriptorPtr pDesc, USBDeviceRef device); ! 98: static OSStatus MouseModuleFinalize(USBDeviceRef theDeviceRef, USBDeviceDescriptorPtr pDesc); ! 99: ! 100: ! 101: /* Prototypes from MouseConfigParse.c Tue, Mar 17, 1998 3:17:14 PM */ ! 102: OSErr FindHIDInterfaceByNumber(LogicalAddress pConfigDesc, UInt32 ReqInterface, USBInterfaceDescriptorPtr * hInterfaceDesc); ! 103: ! 104: OSStatus USBHIDControlDevice(UInt32 theControlSelector, void * theControlData); ! 105: void NotifyRegisteredHIDUser(UInt32 devicetype, UInt8 hidReport[]); ! 106: ! 107: void USBMouseIn(UInt32 refcon, void * theData); ! 108: void InitParamBlock(USBDeviceRef theDeviceRef, USBPB * paramblock); ! 109: ! 110: #define kMouseRetryCount 3 ! 111: ! 112: enum driverstages ! 113: { ! 114: kUndefined = 0, ! 115: kGetFullConfiguration, ! 116: kFindInterfaceAndSetProtocol, ! 117: kSetIdleRequest, ! 118: kFindAndOpenInterruptPipe, ! 119: kReadInterruptPipe, ! 120: kReturnFromDriver = 0x1000, ! 121: kRetryTransaction = 0x2000, ! 122: kSyncTransaction = 0x4000, ! 123: kCompletionPending = 0x8000 ! 124: }; ! 125: ! 126: typedef struct ! 127: { ! 128: USBPB pb; ! 129: void (*handler)(USBPB *pb); ! 130: ! 131: USBDeviceRef deviceRef; ! 132: USBInterfaceRef interfaceRef; ! 133: USBPipeRef pipeRef; ! 134: ! 135: USBDeviceDescriptor deviceDescriptor; ! 136: USBInterfaceDescriptor interfaceDescriptor; ! 137: ! 138: USBConfigurationDescriptorPtr pFullConfigDescriptor; ! 139: USBInterfaceDescriptorPtr pInterfaceDescriptor; ! 140: USBEndPointDescriptorPtr pEndpointDescriptor; ! 141: ! 142: UInt32 hidDeviceType; ! 143: UInt8 hidReport[64]; ! 144: ! 145: HIDInterruptProcPtr pSHIMInterruptRoutine; ! 146: HIDInterruptProcPtr pSavedInterruptRoutine; ! 147: ! 148: UInt32 interruptRefcon; ! 149: ! 150: SInt32 retryCount; ! 151: SInt32 transDepth; ! 152: ! 153: CursorDevicePtr pCursorDeviceInfo; ! 154: CursorDevice cursorDeviceInfo; ! 155: Fixed unitsPerInch; ! 156: } usbMousePBStruct; ! 157: ! 158: #endif //__MouseModuleH__
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.