Native Port Drivers
Open Transport provides the expert for drivers written for PCI-based Power Macintosh computers with the native driver architecture. For your driver to be automatically located and installed by the Open Transport expert, you must first define and export a
DriverDescription
structure as part of your driver so that your driver is added to the Name Registry. This structure is described in
Driver Description Structure.
For Open Transport, the fields of the
DriverDescription
structure must be set as follows:
-
driverDescSignature
-
Must contain the value
kTheDescriptionSignature.
-
driverDescVersion
-
Must contain the value
kInitialDriverDescriptor.
-
driverType.nameInfoStr
-
Fill in with the name of the driver. It must be exactly the same name as the module name pointed to by the
streamtab
structure of the driver (in the
qi_minfo
->
mi_idname
field). The driver name may not end in a digit.
-
driverType.version
-
Fill in with the version number of the driver (not the version number of the device, which is stored in the
driverDescVersion.revisionID
field).
-
DriverOSRuntimeInfo.driverRuntime
-
This field must have the bit
kdriverIsUnderExpertControl
set.
-
DriverOSRuntimeInfo.driverName
-
This field must contain one of the device names found in
OpenTptLinks.h. These include
kEnetName,
kTokenRingName,
kFDDIName, and so on. Remember that this field is a Pascal string, and the equates are for C strings, so you must use code such as
"\p" kEnetName
to get the desired effect.
-
DriverOSRuntimeInfo.driverDescReserved[8]
-
These are reserved fields and should be initialized to 0.
-
DriverOSService.service[x].serviceCategory
-
At least one of your service categories must be filled in with the category
kServiceCategoryopentransport.
-
DriverOSService.service[x].serviceType
-
The service type field is a bit field that tells Open Transport about your device. It has this form:
-
xxxxdddd dddddddd cccccccc xxxxxxTD
-
where the
d
bits indicate the device type for Open Transport, the
c
bits indicate Ethernet framing options (the driver's capability bits), the lower 2 bits (
TD
) state whether the driver is TPI or DLPI, and all other bits are 0 (shown by
x
). The macro
-
OTPCIServiceType
(
devType,
capabilityBits,
isTPI,
isDLPI
)
-
should be used to create this field. The list of device types available is found in the header file
OpenTptLinks.h.
-
DriverOSService.service[x].serviceVersion
-
This field specifies the version of the Open Transport programming interface that your driver supports. It is in the standard
NumVersion
format (the format of a 4-byte
'vers'
resource). Currently, this field should be set to the constant
kOTDriverAPIVersion.
© 1999 Apple Computer, Inc. (Last Updated 26 March 99)