home *** CD-ROM | disk | FTP | other *** search
-
- /*
- File: PrintDriverShell.c
-
- Contains: Toms wrapper for BT's hub driver. Just the header block etc
-
- Version:
-
- */
-
- #include <Types.h>
- #include <Devices.h>
- #include <DriverServices.h>
- #include <USB.h>
-
- #include "PrinterClassDriver.h"
-
- //------------------------------------------------------
- //
- // Protos
- //
- //------------------------------------------------------
- OSStatus printDriverValidateHW(USBDeviceRef device, USBDeviceDescriptor *desc);
- OSStatus printDriverInitialize(USBDeviceRef device, USBDeviceDescriptorPtr pDesc, UInt32 busPowerAvailable);
- OSStatus printDriverInitInterface( UInt32 interfaceNum, USBInterfaceDescriptor *interfaceDesc, USBDeviceDescriptor *deviceDesc, USBDeviceRef device);
- OSStatus printDriverFinalize(USBDeviceRef device, USBDeviceDescriptorPtr desc );
- OSStatus printDriverNotifyProc(UInt32 notification, void *pointer);
-
- //------------------------------------------------------
- //
- // This is the driver description structure that the expert looks for first.
- // If it's here, the information within is used to match the driver
- // to the device whose descriptor was passed to the expert.
- // Information in this block is also used by the expert when an
- // entry is created in the Name Registry.
- //
- //------------------------------------------------------
- enum {
- kMajorRev = 0,
- kMinorAndBugRev = 0,
- kStage = developStage,
- kNonRelRev = 0
- };
-
-
- USBDriverDescription TheUSBDriverDescription =
- {
- // Signature info
- kTheUSBDriverDescriptionSignature,
- kInitialUSBDriverDescriptor,
-
- // Device Info
- 0, // vendor = not device specific
- 0, // product = not device specific
- 0, // version of product = not device specific
- 0, // protocol = not device specific
-
- // Interface Info (* I don't think this would always be required...*)
- 0, // Configuration Value
- 0, // Interface Number
- kUSBPrintClass, // Device Class (from USBDeviceDefines.h)
- kUSBPrintSubClass, // Device Subclass
- 0, // Interface Protocol
-
-
- // Driver Info
- "\pUSBPrint", // Driver name for Name Registry
- kUSBPrintClass, // Device Class (from USBDeviceDefines.h)
- kUSBPrintSubClass, // Device Subclass
- kMajorRev, kMinorAndBugRev, kStage, kNonRelRev, // version of driver
-
- // Driver Loading Info
- 0x00000000 // Flags (currently undefined)
- };
-
-
- USBClassDriverPluginDispatchTable TheClassDriverPluginDispatchTable =
- {
- kClassDriverPluginVersion, // Version of this structure
- printDriverValidateHW, // Hardware Validation Procedure
- printDriverInitialize, // Initialization Procedure
- printDriverInitInterface, // Interface Initialization Procedure
- printDriverFinalize, // Finalization Procedure
- printDriverNotifyProc, // Driver Notification Procedure
- };
-
- // Hardware Validation
- // Called upon load by Expert
- OSStatus
- printDriverValidateHW(USBDeviceRef device, USBDeviceDescriptor *desc)
- {
- device = 0;
- desc = 0;
- return (OSStatus)noErr;
- }
-
-
- // Initialization function
- // Called upon load by Expert
- OSStatus
- printDriverInitialize(USBDeviceRef device, USBDeviceDescriptorPtr pDesc,
- UInt32 busPowerAvailable)
- {
- busPowerAvailable = 0;
-
- PrintDriverEntry(device, pDesc, NULL );
- return (OSStatus)noErr;
- }
-
- // printDriverInitInterface function
- // Called to initialize driver for an individual interface - either by expert or
- // internally by driver
- OSStatus
- printDriverInitInterface(
- UInt32 interfaceNum,
- USBInterfaceDescriptor *interfaceDesc,
- USBDeviceDescriptor *deviceDesc,
- USBDeviceRef device)
- {
- interfaceNum = 0;
-
- PrintDriverEntry(device, deviceDesc, interfaceDesc );
-
- return (OSStatus)noErr;
- }
-
- // Termination function
- // Called by Expert when driver is being shut down
- OSStatus
- printDriverFinalize(USBDeviceRef device, USBDeviceDescriptorPtr desc )
- {
- #pragma unused(device)
- #pragma unused(desc)
-
- return PrintDriverFinalize();
- }
-
- OSStatus
- printDriverNotifyProc(UInt32 notification, void *pointer)
- {
- pointer = 0;
- notification = 0;
- return(noErr);
- }
-