| Document Information Preface Part I Designing Device Drivers for the Solaris Platform 1.  Overview of Solaris Device Drivers 2.  Solaris Kernel and Device Tree 3.  Multithreading 4.  Properties 5.  Managing Events and Queueing Tasks 6.  Driver Autoconfiguration 7.  Device Access: Programmed I/O 8.  Interrupt Handlers 9.  Direct Memory Access (DMA) 10.  Mapping Device and Kernel Memory 11.  Device Context Management 12.  Power Management 13.  Hardening Solaris Drivers 14.  Layered Driver Interface (LDI) Part II Designing Specific Kinds of Device Drivers 15.  Drivers for Character Devices 16.  Drivers for Block Devices 17.  SCSI Target Drivers 18.  SCSI Host Bus Adapter Drivers 19.  Drivers for Network Devices 20.  USB Drivers Part III Building a Device Driver 21.  Compiling, Loading, Packaging, and Testing Drivers 22.  Debugging, Testing, and Tuning Device Drivers 23.  Recommended Coding Practices Part IV Appendixes A.  Hardware Overview B.  Summary of Solaris DDI/DKI Services C.  Making a Device Driver 64-Bit Ready D.  Console Frame Buffer Drivers Index |       	 
             D
data alignment for SPARC, SPARC Data Alignment 
data corruption
control data, Corruption of Device Management and Control Datadetecting, Detecting Corrupted Datadevice management data, Corruption of Device Management and Control Datamalignant, definition of, Corruption of Device Management and Control Datamisleading, definition of, Corruption of Device Management and Control Dataof received data, Corruption of Received Data 
data sharing
using devmap(), Data Sharing in devmap()using ioctl(), Data Sharing in ioctl()using mmap(), Data Sharing in mmap() 
data storage classes, Storage Classes of Driver Data 
data structures
dev_ops structure, dev_ops StructureGLD
Declarations and Data Structuresgld_stats Structuremodldrv structure, modldrv Structure 
data transfers, character drivers, I/O Request Handling 
DDI-compliant drivers
byte ordering, Endiannesscompliance testing, DDI/DKI Compliance Testing 
ddi_create_minor_node() function, Creating Minor Device Nodes 
ddi_device_acc_attr structure, Access Attributes Structure 
ddi_device_copy() function, ddi_device_copy() Argument Changes 
ddi_device_zero() function, ddi_device_zero() Argument Changes 
ddi_devid_free() function, Retrieving Target Device Information 
DDI/DKI
See also LDIdesign considerations, DDI/DKI Facilitiesand disk performance, Disk Performanceoverview, DDI/DKI Interfacespurpose in kernel, What Is the Kernel? 
ddi_dma_attr structure
ddi_dma_attr StructureDMA Attributes Structureddi_dma_attr 
ddi_dma_cookie structure, ddi_dma_cookie Structure Changes 
ddi_dma_getwin() function, DMA Software Components:  Handles, Windows, and Cookies 
ddi_dma_mem_alloc() function, ddi_dma_mem_alloc() Argument Changes 
ddi_dma_nextseg() function, DMA Software Components:  Handles, Windows, and Cookies 
ddi_dma_sync() function
DMA IsolationConfiguring the Test Harness 
ddi_driver_major() function
Block Device AutoconfigurationBlock Device Autoconfiguration 
ddi_enter_critical() function, Timing-Critical Sections 
ddi_eventcookie_t, Receiving Asynchronous Device Event Notification 
ddi_fm_acc_err_clear() function, Getting Error Status 
ddi_fm_acc_err_get() function
Access Attributes StructureAccess Attributes Structure 
ddi_fm_capable() function, Getting the Fault Management Capability Bit Mask 
ddi_fm_dma_err_get() function, DMA Attributes Structure 
ddi_fm_ereport_post() function
Reporting ErrorsReporting Errors 
ddi_fm_error structure
Registering an Error HandlerRegistering an Error HandlerFault Management Data and Status Structure 
ddi_fm_fini() function, Cleaning Up Fault Management Resources 
ddi_fm_handler_register() function
Access Attributes StructureRegistering an Error Handler 
ddi_fm_handler_unregister() function, Registering an Error Handler 
ddi_fm_init() function, Declaring Fault Management Capabilities 
ddi_fm_service_impact() function, Reporting Errors 
DDI function tables, Summary of Solaris DDI/DKI Services 
ddi_get_cred() function
drv_getparm() Argument ChangesData Sharing in ioctl() 
ddi_get_driver_private() function
scsi_device StructureGLD Driver Requirements 
ddi_get_instance() function, gld_mac_info Structure 
ddi_get_lbolt() function, drv_getparm() Argument Changes 
ddi_get_pid() function, drv_getparm() Argument Changes 
ddi_get_time() function, drv_getparm() Argument Changes 
ddi_get()X functions
Exclusive Use of DDI Access HandlesFault Injection 
DDI_INFO_DEVT2DEVINFO, getinfo() Entry Point 
DDI_INFO_DEVT2INSTANCE, getinfo() Entry Point 
ddi_intr_add_handler() function
MSI-X InterruptsInterrupt Initialization and Destruction FunctionsRegistering Interrupts 
ddi_intr_add_softint() function, Soft Interrupt Functions 
ddi_intr_alloc() function
MSI-X InterruptsInterrupt Initialization and Destruction Functions 
ddi_intr_block_disable() function, Interrupt Initialization and Destruction Functions 
ddi_intr_block_enable() function, Interrupt Initialization and Destruction Functions 
DDI_INTR_CLAIMED, Interrupt Handler Functionality 
ddi_intr_clr_mask() function
Interrupt Initialization and Destruction FunctionsInterrupt Function Examples 
ddi_intr_disable() function
MSI-X InterruptsInterrupt Initialization and Destruction Functions 
ddi_intr_dup_handler() function
MSI-X InterruptsInterrupt Initialization and Destruction Functions 
ddi_intr_enable() function
MSI-X InterruptsInterrupt Initialization and Destruction Functions 
ddi_intr_free() function
MSI-X InterruptsInterrupt Initialization and Destruction Functions 
ddi_intr_get_cap() function, Interrupt Capability Functions 
ddi_intr_get_hilevel_pri() function
Priority Management FunctionsHandling High-Level Interrupts 
ddi_intr_get_navail() function, Interrupt Capability Functions 
ddi_intr_get_nintrs() function, Interrupt Capability Functions 
ddi_intr_get_pending() function
Interrupt Initialization and Destruction FunctionsInterrupt Function Examples 
ddi_intr_get_pri() function
Priority Management FunctionsHandling High-Level Interrupts 
ddi_intr_get_softint_pri() function, Soft Interrupt Functions 
ddi_intr_get_supported_types() function, Interrupt Capability Functions 
ddi_intr_hilevel() function, High-Level Interrupts 
ddi_intr_remove_handler() function
MSI-X InterruptsInterrupt Initialization and Destruction Functions 
ddi_intr_remove_softint() function, Soft Interrupt Functions 
ddi_intr_set_cap() function, Interrupt Initialization and Destruction Functions 
ddi_intr_set_mask() function
Interrupt Initialization and Destruction FunctionsInterrupt Function Examples 
ddi_intr_set_pri() function, Priority Management Functions 
ddi_intr_set_softint_pri() function
Soft Interrupt FunctionsInterrupt Function Examples 
ddi_intr_trigger_softint() function
High-Level InterruptsSoft Interrupt Functions 
DDI_INTR_UNCLAIMED, Interrupt Handler Functionality 
ddi_log_sysevent() function
Using ddi_log_sysevent() to Log EventsUsing ddi_log_sysevent() to Log Events 
ddi_model_convert_from() function, Data Sharing in ioctl() 
ddi_peek() function, Access Attributes Structure 
ddi_poke() function, Access Attributes Structure 
ddi_prop_free() function, Driver Source File 
ddi_prop_get_int() function, HBA Configuration Properties 
ddi_prop_lookup() function, Looking Up Properties 
ddi_prop_lookup_string() function, Driver Source File 
ddi_prop_op() function, prop_op() Entry Point 
ddi_ptob() function, DMA Isolation 
ddi_put()X functions
Exclusive Use of DDI Access HandlesFault Injection 
ddi_regs_map_setup() function
ddi_device_acc_attr StructureExclusive Use of DDI Access HandlesFault InjectionConfiguring the Test Harness 
ddi_removing_power() function, detach() Entry Point 
ddi_rep_get()X functions, Exclusive Use of DDI Access Handles 
ddi_rep_put()X functions, Exclusive Use of DDI Access Handles 
DDI_RESUME, detach() function, detach() Entry Point 
ddi_set_driver_private() function, scsi_device Structure 
DDI_SUSPEND, detach() function, detach() Entry Point 
ddi_umem_alloc() function
Allocating Kernel Memory for User AccessDMA Isolation 
ddi_umem_free() function, Freeing Kernel Memory Exported for User Access 
DDX module, The X Window System Frame Buffer Specific DDX Module 
DE (diagnosis engine), definition, Diagnosing Faults 
deadman kernel feature, Enable the Deadman Feature to Avoid a Hard Hang 
DEBUG symbol
Compiling and Linking the DriverUse ASSERT() to Catch Invalid Assumptions 
debugging
ASSERT() macro, Use ASSERT() to Catch Invalid Assumptionsbooting an alternate kernel, To Boot With an Alternate Kernelcoding hints, Debugging Preparation Techniquescommon tasks, Useful Debugging Tasks With kmdb and mdbconditional compilation, Use Conditional Compilation to Toggle Costly Debugging Featuresconsole frame buffer drivers, Developing, Testing, and Debugging Console Frame Buffer DriversDEBUG symbol, Use ASSERT() to Catch Invalid Assumptionsdetecting kernel memory leaks, Detecting Kernel Memory Leaksdisplaying kernel data structures, Obtaining Kernel Data Structure Informationsystem file, Setting Up Test Moduleskmdb debugger, Using the kmdb Kernel Debuggerkmem_flags, Setting kmem_flags Debugging Flagsmdb debugger, Using the mdb Modular Debuggermoddebug, Loading and Unloading Test Modulespostmortem, Postmortem Debuggingpreparing for disasters, Avoiding Data Loss on a Test Systemsetting up a serial connection, Testing With a Serial Connectionsetting up a SPARC test system, Setting Up a Target System on the SPARC Platformsetting up an x86 test system, Setting Up a Target System on the x86 Platformsystem registers, Exploring System Registers With kmdbtools, Debugging Toolsusing kernel variables, Modifying Kernel Variablesusing the SPARC PROM for device debugging, PROM on SPARC Machineswriting mdb commands, Writing Debugger Commands With mdb 
delay() function, delay() and timeout() Argument Changes
changes to, delay() and timeout() Argument Changes 
dependency, Power Management Dependencies 
deprecated device access functions, User Application Kernel and Device Access Functions 
deprecated DMA functions, Direct Memory Access (DMA) Functions 
deprecated interrupt functions, Interrupt Functions 
deprecated memory allocation functions, Memory Allocation and Deallocation Functions 
deprecated power management functions, Power Management Functions 
deprecated programmed I/O functions, Programmed I/O Functions 
deprecated property functions, Property Functions 
deprecated SCSI functions, SCSI Functions 
deprecated time-related functions, Time-Related Functions 
deprecated user application kernel functions, User Application Kernel and Device Access Functions 
deprecated user process information functions, User Process Information Functions 
deprecated user space access functions, User Space Access Functions 
deprecated virtual memory functions, Virtual Memory Functions 
descriptor tree
The Descriptor TreeRegistering Drivers to Gain Device Access 
dest_adcent argument, ddi_device_copy(), changes to, ddi_device_copy() Argument Changes 
detach() entry point
active power management, Device Power Managementdescription of, detach() Entry Pointhot removal, Hot Removalsystem power management, System Power Management 
detecting kernel memory leaks with mdb, Detecting Kernel Memory Leaks 
dev_advcnt argument, ddi_device_zero(), changes to, ddi_device_zero() Argument Changes 
dev_datasz argument, ddi_device_copy(), changes to, ddi_device_copy() Argument Changes 
dev_datasz argument, ddi_device_zero(), changes to, ddi_device_zero() Argument Changes 
dev_info_t functions, Device Information Tree Node (dev_info_t) Functions 
dev_ops structure, description of, dev_ops Structure 
dev_t functions, Device (dev_t) Functions 
devfsadm command, Installing Drivers with add_drv 
device
alternate settings, How USB Devices Appear to the Systemcomposite
Devices With Multiple InterfacesManaging Entire Devicesconfigurations, How USB Devices Appear to the Systemendpoints, How USB Devices Appear to the Systeminterface number, Getting Interface Numbersinterfaces, How USB Devices Appear to the Systemsplitting interfaces
Devices With Multiple InterfacesMultiple-Configuration Devices 
device access functions
block drivers, open() Entry Point (Block Drivers)character drivers, open() Entry Point (Character Drivers)deprecated, User Application Kernel and Device Access Functionstable, User Application Kernel and Device Access Functions 
device configuration, entry points, Device Configuration Concepts 
device context management, What Is a Device Context?
entry points, Entry Points for Device Context Managementmodel, Context Management Modeloperation, Context Management Operation 
device-dependency, power.conf entry, Power Management Dependencies 
device-dependency-property, power.conf entry, Power Management Dependencies 
device directory, recovering, Recovering the Device Directory 
device drivers
See also compiling driversSee also linking driversSee also loading drivers64-bit drivers
I/O Control Support for 64-Bit Capable Device DriversMaking a Device Driver 64-Bit Readyaccess from within kernel, Layered Driver Interface (LDI)aliases, Updating Driver Informationbinding to device node
Binding a Driver to a DeviceCompatible Device Namesbindings, Checking Device Driver Bindingsblock driver, Entry Points for Block Device Driversconfiguration descriptor clouds, Hot Reinsertioncontext, Driver Contextdebugging, Debugging, Testing, and Tuning Device Drivers
definition, What Is a Device Driver?coding hints, Debugging Preparation Techniquessetting up a serial connection, Testing With a Serial Connectiontools, Debugging Toolsusing the PROM, PROM on SPARC Machinesentry points, What Is a Device Driver Entry Point?error handling, Error Handlingheader files, Header Fileshubd USB hub driver, Hot Insertioninterface association nodes, Devices With Interface-Association Descriptorsloadable interface, Loadable Driver Interfacesmodifying information with update_drv, Updating Driver Informationmodifying permissions, Updating Driver Informationmodule configuration, Source Filesnetwork drivers, Drivers for Network Devicesofflining
Hotplug CallbacksHot Removalpackaging, Driver Packagingprinting messages, Returning Errorspurpose in kernel, What Is the Kernel?source files, Source Filesstandard character driver, Entry Points for Character Device Driverstesting
Criteria for Testing DriversTesting Driverstuning, Tuning DriversUSB driver, USB Driversusb_ia USB interface association driver, Devices With Interface-Association Descriptorsusb_mid USB multi-interface driver
Devices With Multiple InterfacesDevices With Interface-Association DescriptorsHot RemovalGetting Interface Numbersusing kstats, Kernel Statistics 
device ID functions, Device ID Functions 
device information
binding a driver to a device, Binding a Driver to a Devicebinding a driver to a USB device, Compatible Device Namescompatible device names, Compatible Device Namesdi_link_next_by_lnode() function, Device Information Library Interfacesdi_link_next_by_node() function, Device Information Library Interfacesdi_link_private_get() function, Device Information Library Interfacesdi_link_private_set() function, Device Information Library Interfacesdi_link_spectype() function, Device Information Library Interfacesdi_link_t, Device Information Library Interfacesdi_link_to_lnode() function, Device Information Library Interfacesdi_lnode_devinfo() function, Device Information Library Interfacesdi_lnode_devt() function, Device Information Library Interfacesdi_lnode_name() function, Device Information Library Interfacesdi_lnode_next() function, Device Information Library Interfacesdi_lnode_private_get() function, Device Information Library Interfacesdi_lnode_private_set() function, Device Information Library Interfacesdi_lnode_t, Device Information Library Interfacesdi_node_t, Device Information Library Interfacesdi_walk_link() function, Device Information Library Interfacesdi_walk_lnode() function, Device Information Library InterfacesDINFOLYR, Device Information Library InterfacesLDI, Retrieving Target Device Informationlnode, Device Information Library Interfacesnblocks property, Device SizesNblocks property, Device Sizesproperty values, Retrieving Target Device Property Valuesself-identifying, Device Identificationtree structure
Device Tree ComponentsDevice Tree Components 
device instances, Fault Injection 
device interrupts, See interrupts; interrupt handling 
device layering, See LDI 
device memory
D_DEVMAP flag in cb_ops, cb_ops Structuremapping
Entry Points for Memory Mapped DevicesMapping Device and Kernel Memory 
device node, USB Devices and the Solaris Device Tree 
device number, description of, Devices as Special Files 
device polling, Interrupt Handler Functionality
in character drivers, Multiplexing I/O on File Descriptorschpoll() function, Multiplexing I/O on File Descriptorspoll() function, Multiplexing I/O on File Descriptors 
device power management
components, Power Management Componentsdefinition of, Power Management Frameworkdependency, Power Management Dependenciesentry points, power() Entry Pointinterfaces, Device Power Management Interfacesmodel, Device Power Management Modelpm_busy_component() function
Power Management StatesBusy-Idle State TransitionsDevice Power ManagementDevice Power Managementpm_idle_component() function
Power Management StatesBusy-Idle State TransitionsBusy-Idle State TransitionsDevice Power ManagementDevice Power Managementpm_lower_power() function
Power LevelsDevice Power Managementpm_raise_power() function
Multiple Power Management ComponentsPower LevelsBusy-Idle State TransitionsDevice Power ManagementDevice Power Managementpower() entry point
Device Power ManagementDevice Power Managementpower() function, power() Entry Pointpower levels, Power Levelsstate transitions, Busy-Idle State Transitionsusb_create_pm_components() function, Device Power ManagementUSB devices, Device Power Management 
device registers, mapping, attach() Entry Point 
device state in power management, Hardware State 
device tree
displaying, Displaying the Device Treenavigating, in debugger, Obtaining Device Tree Informationoverview, Device Tree Componentspurpose in kernel, What Is the Kernel? 
device usage, Kernel Interfaces
See LDI 
/devices directory
description of, Devices as Special Filesdisplaying the device tree, /devices Directory 
devinfo tree, Fault Injection 
devmap_ entry point, devmap_access() function, devmap_access() Entry Point 
devmap_ entry points
devmap_access() function, devmap_unload() Entry Pointdevmap_contextmgt()function, devmap_contextmgt() Entry Pointdevmap_dup() function, devmap_dup() Entry Pointdevmap() function, The devmap(9E) Entry Pointdevmap_map() function, devmap_map() Entry Pointdevmap_unmap() function, devmap_unmap() Entry Point 
devmap_ functions
devmap_devmem_setup() function, Associating Device Memory With User Mappingsdevmap_load() function, devmap_load() Entry Pointdevmap_umem_setup() function, Exporting Kernel Memory to Applicationsdevmap_unload() function, devmap_unload() Entry Point 
diagnosis engine, definition, What Is Predictive Self-Healing? 
.dict dictionary files, Message IDs and Dictionary Files 
disaster recovery, Recovering the Device Directory 
disk
I/O controls, Disk ioctlsperformance, Disk Performance 
disk driver testing, Disk Drivers 
DKI, See DDI/DKI 
DL_CLDLS, DLPI symbols, Implemented DLPI Primitives 
DL_ETHER
Ethernet V2 packet processing, Type DL_ETHER: Ethernet V2 and ISO 8802-3 (IEEE 802.3)GLD support
Generic LAN Driver OverviewType DL_ETHER: Ethernet V2 and ISO 8802-3 (IEEE 802.3)ISO 8802-3 (IEEE 802.3) packet processing, Type DL_ETHER: Ethernet V2 and ISO 8802-3 (IEEE 802.3)network statistics, Network Statistics 
DL_FDDI
GLD support
Generic LAN Driver OverviewTypes DL_TPR and DL_FDDI: SNAP ProcessingSNAP processing, Types DL_TPR and DL_FDDI: SNAP Processing 
DL_STYLE1, DLPI symbols, Implemented DLPI Primitives 
DL_STYLE2, DLPI symbols, Implemented DLPI Primitives 
DL_TPR
GLD support
Generic LAN Driver OverviewTypes DL_TPR and DL_FDDI: SNAP ProcessingType DL_TPR: Source RoutingSNAP processing, Types DL_TPR and DL_FDDI: SNAP Processingsource routing, Type DL_TPR: Source Routing 
DL_VERSION_2, DLPI symbols, Implemented DLPI Primitives 
DLIOCRAW, ioctl() function, Implemented ioctl Functions 
DLPI primitives, Implemented DLPI Primitives
DL_ATTACH_REQ
Style 1 and Style 2 DLPI ProvidersImplemented DLPI PrimitivesDL_BIND_REQ
Implemented DLPI PrimitivesImplemented DLPI PrimitivesDL_DETACH_REQ
Implemented DLPI PrimitivesImplemented DLPI PrimitivesDL_DISABMULTI_REQ
Implemented DLPI PrimitivesImplemented DLPI PrimitivesDL_ENABMULTI_REQ
Implemented DLPI PrimitivesImplemented DLPI PrimitivesDL_GET_STATISTICS_ACK
Implemented DLPI PrimitivesImplemented DLPI PrimitivesDL_GET_STATISTICS_REQ
Implemented DLPI PrimitivesImplemented DLPI PrimitivesNetwork StatisticsDL_INFO_ACK, Implemented DLPI PrimitivesDL_INFO_REQ, Implemented DLPI PrimitivesDL_PHYS_ADDR_ACK, Implemented DLPI PrimitivesDL_PHYS_ADDR_REQ, Implemented DLPI PrimitivesDL_PROMISCOFF_REQ
Implemented DLPI PrimitivesImplemented DLPI PrimitivesDL_PROMISCON_REQ
Implemented DLPI PrimitivesImplemented DLPI PrimitivesDL_SET_PHYS_ADDR_REQ
Implemented DLPI PrimitivesImplemented DLPI PrimitivesDL_UNATTACHED_REQ, Implemented DLPI PrimitivesDL_UNBIND_REQ
Implemented DLPI PrimitivesImplemented DLPI PrimitivesDL_UNITDATA_IND, Implemented DLPI PrimitivesDL_UNITDATA_REQ, Implemented DLPI Primitives 
DLPI providers, Style 1 and Style 2 DLPI Providers 
DLPI symbols
DL_CLDLS, Implemented DLPI PrimitivesDL_STYLE1, Implemented DLPI PrimitivesDL_STYLE2, Implemented DLPI PrimitivesDL_VERSION_2, Implemented DLPI Primitives 
DMA
buffer allocation, Allocating Private DMA Buffersburst sizes, Determining Maximum Burst Sizescallbacks, Canceling DMA Callbackscookie
DMA ModelDMA Software Components:  Handles, Windows, and Cookiesfreeing handle, Freeing the DMA Handlefreeing resources, Freeing the DMA Resourceshandle
DMA ModelDMA Software Components:  Handles, Windows, and CookiesAllocating a DMA Handleobject, DMA Modelobject locking, Object Lockingoperations, DMA Operationsphysical addresses, Types of Host Platform DMAprivate buffer allocation, Allocating Private DMA Buffersregister structure, Device Register Structureresource allocation, Allocating DMA Resourcesrestrictions, DMA Attributestransfers
DMA OperationsDMA Transfers (Synchronous)virtual addresses, Types of Host Platform DMAwindows
DMA Software Components:  Handles, Windows, and CookiesDMA Windows 
DMA functions, Direct Memory Access (DMA) Functions
deprecated, Direct Memory Access (DMA) Functions 
driver binding name, Binding a Driver to a Device 
driver.conf files, See hardware configuration files 
driver instances, Using Separate Device Driver Instances 
driver module entry points, See entry points 
drivers, requests from user applications, Threats From Top-Down Requests 
drv_getparm() function, changes to, drv_getparm() Argument Changes 
drv_usecwait(9F), Delays 
DTrace
definition, DTrace for Dynamic Instrumentationtask queues, Task Queue DTrace SDT Probes 
dump() entry point, block drivers, dump() Entry Point (Block Drivers) 
DVMA
SBus slots supporting, Physical SBus Addressesvirtual addresses, Types of Host Platform DMA 
dynamic memory allocation, Dynamic Memory Allocation |