man pages section 9: DDI and DKIProperties and Data StructuresSun Microsystems, Inc.4150 Network CircleSanta Clara, CA 95054U.S.A.Part No: 816–5226–10
one condition can cause the same error, eachcondition is described in a separate paragraphunder the error code.USAGE This section lists special rules,
CMD_NOMSGOUT Target refused to go to message out phase.CMD_XID_FAIL Extended identify message rejected.CMD_IDE_FAIL “Initiator Detected Error” message
scsi_status – SCSI status structure#include <sys/scsi/scsi.h>Solaris DDI specific (Solaris DDI)The SCSI-2standard defines a status byte that is no
STATUS_INTERMEDIATE_MET This status is a combination ofSTATUS_MET andSTATUS_INTERMEDIATE.STATUS_RESERVATION_CONFLICT This status is a combination ofST
streamtab – STREAMS entity declaration structure#include <sys/stream.h>Architecture independent level 1 (DDI/DKI).Each STREAMS driver or module
stroptions – options structure for M_SETOPTS message#include <sys/stream.h>#include <sys/stropts.h>#include <sys/ddi.h>#include <
When SO_READOPT is set, the so_readopt field of the stroptions structure cantake one of the following values. See read(2).RNORM Read message normal.RMS
tuple – card information structure (CIS) access structure#include <sys/pccard.h>Solaris DDI Specific (Solaris DDI)The tuple_t structure is the ba
/* body tuple data */cisdata_t TupleCode; /* tuple type code */cisdata_t TupleLink; /* tuple link */The fields are defined as follows:Socket Not used in
csx_GetFirstTuple(9F), csx_GetTupleData(9F), csx_ParseTuple(9F),csx_Parse_CISTPL_BATTERY(9F), csx_Parse_CISTPL_BYTEORDER(9F),csx_Parse_CISTPL_CFTABLE_
uio – scatter/gather I/O request structure#include <sys/uio.h>Architecture independent level 1 (DDI/DKI)A uio structure describes an I/O request
DIAGNOSTICS This section lists diagnostic messages with a briefexplanation of the condition causing the error.WARNINGS This section lists warnings abo
When performing I/O on a seekable device, the driver should not modify either theuio_offset or the uio_loffset field of the uio structure. I/O to such
IndexAaio_req — asynchronous I/O requeststructure, 18asynchronous I/O request structure —aio_req, 18Bbuf — block I/O data transfer structure, 19CCard
DMA Request structure, — ddi_dma_req, 43driver’s message-freeing routine, —free_rtn, 53drivers, loadable, linkage structure, —modldrv, 68Ffmodsw — STR
scsi_inquiry — SCSI device structure, 94SCSI packet structure — scsi_pkt, 97scsi_pkt — SCSI packet structure, 97pkt_flags Definitions, 98pkt_reason Defin
114 man pages section 9: DDI and DKI Properties and Data Structures • December 2002
12 man pages section 9: DDI and DKI Properties and Data Structures • December 2002
Introduction13
Intro – introduction to kernel data structures and propertiesSection 9P describes kernel properties used by device drivers. Section 9S describes theda
The following table summarizes structures that are not specific to STREAMS I/O.Structure Typeaio_req Solaris DDIbuf DDI/DKIcb_ops Solaris DDIddi_device
Structure Typescsi_hba_tran Solaris DDIscsi_inquiry Solaris DDIscsi_pkt Solaris DDIscsi_status Solaris DDIuio DDI/DKIIntro(9E)Do not declare arrays of
Data Structures for Drivers17
aio_req – asynchronous I/O request structure#include <sys/uio.h>#include <sys/aio_req.h>#include <sys/ddi.h>#include <sys/sunddi.
buf – block I/O data transfer structure#include <sys/ddi.h>#include <sys/sunddi.h>Architecture independent level 1 (DDI/DKI)The buf struct
Copyright 2002 Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, CA 95054 U.S.A. All rights reserved.This product or document is protected by c
B_BUSY Indicates the buffer is in use. The driver must not change this flagunless it allocated the buffer with getrbuf(9F) and no I/Ooperation is in pr
b_error can hold an error code that should be passed as a return code from thedriver. b_error is set in conjunction with the B_ERROR bit set in the b_
cb_ops – character/block entry points structure#include <sys/conf.h>#include <sys/ddi.h>#include <sys/sunddi.h>Solaris DDI specific (
block/char Function Descriptionc XXprop_op DDI(Sun)c XXaread DDI(Sun)c XXawrite DDI(Sun)int (*cb_open)(dev_t *devp, int flag, int otyp, cred_t *credp)
copyreq – STREAMS data structure for the M_COPYIN and the M_COPYOUTmessage types#include <sys/stream.h>Architecture independent level 1 (DDI/DKI
copyresp – STREAMS data structure for the M_IOCDATA message type#include <sys/stream.h>Architecture independent level 1 (DDI/DKI)The data struct
datab – STREAMS message data structure#include <sys/stream.h>Architecture independent level 1 (DDI/DKI).The datab structure describes the data o
ddi_device_acc_attr – data access attributes structure#include <sys/ddi.h>#include <sys/sunddi.h>Solaris DDI specific (Solaris DDI).The ddi
one halfword store. It can also batchindividual loads. For example, the CPUmight turn two consecutive byte loads intoone halfword load. DDI_MERGING_OK
EXAMPLE 1 Using ddi_device_acc_attr() in ddi_regs_map_setup(9F)(Continued)*/ddi_regs_map_setup(dip, rnumber, (caddr_t *)&dev_addr, offset, len,&am
ContentsPreface 7Introduction 13Intro(9S) 14Data Structures for Drivers 17aio_req(9S) 18buf(9S) 19cb_ops(9S) 22copyreq(9S) 24copyresp(9S) 25datab(9S)
EXAMPLE 2 Accessing a Device with Different Apertures (Continued)EXAMPLE 3 Functions That Call Out the Data Word SizeThe following example illustrates
ddi_dma_attr – DMA attributes structure#include <sys/ddidmareq.h>Solaris DDI specific (Solaris DDI).A ddi_dma_attr_t structure describes device–
The dma_attr_burstsizes field describes the possible burst sizes the device’sDMA engine can accept. The format of the data sizes is binary encoded in t
address by the system in order to perform the transfer. In this case, the underlyingplatform provides an IOMMU, which translates accesses to these vir
ddi_dma_cookie – DMA address cookie#include <sys/sunddi.h>Solaris DDI specific (Solaris DDI).The ddi_dma_cookie_t structure contains DMA address
ddi_dmae_req – DMA engine request structure#include <sys/dma_engine.h>Solaris IA DDI specific (Solaris IA DDI).A device driver uses the ddi_dmae_
architecture. A driver must determine whether its parent bus nexus supports thisfeature by examining the scatter/gather list size returned in the dlim
Second, on some bus architectures, the driver’s nextcookie routine can becalled from a high-level interrupt routine. If the cookies were not prefetch
ATTRIBUTE TYPE ATTRIBUTE VALUEArchitecture IAeisa(4), isa(4), attributes(5), ddi_dma_segtocookie(9F), ddi_dmae(9F),ddi_dma_lim_IA(9S), ddi_dma_req(9S)
ddi_dma_lim_sparc, ddi_dma_lim – SPARC DMA limits structure#include <sys/ddidmareq.h>Solaris SPARC DDI specific (Solaris SPARC DDI).This page des
free_rtn(9S) 53gld_mac_info(9S) 54gld_stats(9S) 57inquiry-device-type(9P) 59iocblk(9S) 60iovec(9S) 61kstat(9S) 62kstat_intr(9S) 64kstat_io(9S) 65kstat
The dlim_minxfer field describes the minimum effective DMA transfer size (in unitsof bytes). It must be a power of two. This value specifies the minimum
ddi_dma_lim_x86 – IA DMA limits structure#include <sys/ddidmareq.h>Solaris IA DDI specific (Solaris IA DDI)A ddi_dma_lim structure describes in a
The dlim_adreg_max field describes an inclusive upper bound for the device’s DMAengine address register. This bound handles a fairly common case where
ddi_dma_req – DMA Request structure#include <sys/ddidmareq.h>Solaris DDI specific (Solaris DDI).A ddi_dma_req structure describes a request for D
Many machine implementations make this non-sequential memory access difficult tocontrol in a generic and seamless fashion. Therefore, explicit synchro
The dmao_type element selects the kind of object described by dmao_obj. It can beset to DMA_OTYP_VADDR, indicating virtual addresses.The last element,
ddi-forceattach, ddi-no-autodetach – properties controlling driver attach/detachbehaviorSolaris device drivers are attached by devfsadm(1M) and by the
ddi_idevice_cookie – device interrupt cookie#include <sys/ddi.h>#include <sys/sunddi.h>Solaris DDI specific (Solaris DDI).The ddi_idevice_c
ddi_mapdev_ctl – device mapping-control structure#include <sys/conf.h>#include <sys/devops.h>Solaris DDI specific (Solaris DDI).Future rele
devmap_callback_ctl – device mapping-control structure#include <sys/ddidevmap.h>Solaris DDI specific (Solaris DDI).A devmap_callback_ctl structur
Index 111Contents 5
size_t len, uint_t type, uint_t rw);int (*devmap_dup)(devmap_cookie_t dhp, void *pvtp,devmap_cookie_t new_dhp, void **new_pvtp);void (*devmap_unmap)(d
dev_ops – device operations structure#include <sys/conf.h>#include <sys/devops.h>Solaris DDI specific (Solaris DDI).dev_ops contains driver
fmodsw – STREAMS module declaration structure#include <sys/stream.h>#include <sys/conf.h>Solaris DDI specific (Solaris DDI)The fmodsw struc
free_rtn – structure that specifies a driver’s message-freeing routine#include <sys/stream.h>Architecture independent level 1 (DDI/DKI).The free_
gld_mac_info – Generic LAN Driver MAC info data structure#include <sys/gld.h>Solaris architecture specific (Solaris DDI).The Generic LAN Driver (
Conventionally, this is used as a pointer to private data,pointing to a driver-defined and driver-allocatedper-instance data structure.The following gr
gldm_addrlen The length in bytes of physical addresses handled bythe device. For Ethernet, Token Ring, and FDDI, thevalue of this structure member sho
gld_stats – Generic LAN Driver statistics data structure#include <sys/gld.h>Solaris architecture specific (Solaris DDI).The Generic LAN Driver (G
uint32_t glds_dot5_lost_frame_error /* lost_frame_errors */uint32_t glds_dot5_frame_copied_error /* frame_copied_errors */uint32_t glds_dot5_token_err
inquiry-device-type, inquiry-vendor-id, inquiry-product-id, inquiry-revision-id –properties from SCSI inquiry dataThese are optional properties create
6 man pages section 9: DDI and DKI Properties and Data Structures • December 2002
iocblk – STREAMS data structure for the M_IOCTL message type#include <sys/stream.h>Architecture independent level 1 (DDI/DKI).The iocblk data st
iovec – data storage structure for I/O using uio#include <sys/uio.h>Architecture independent level 1 (DDI/DKI).An iovec structure describes a da
kstat – kernel statistics structure#include <sys/types.h>#include <sys/kstat.h>#include <sys/ddi.h>#include <sys/sunddi.h>Sola
acquire this lock for all of their operations on that kstat.Itisupto the kstat provider to decide whether guaranteeing consistentdata to kstat clients
kstat_intr – structure for interrupt kstats#include <sys/types.h>#include <sys/kstat.h>#include <sys/ddi.h>#include <sys/sunddi.h
kstat_io – structure for I/O kstats#include <sys/types.h>#include <sys/kstat.h>#include <sys/ddi.h>#include <sys/sunddi.h>Sola
kstat_named – structure for named kstats#include <sys/types.h>#include <sys/kstat.h>#include <sys/ddi.h>#include <sys/sunddi.h>
linkblk – STREAMS data structure sent to multiplexor drivers to indicate a link#include <sys/stream.h>Architecture independent level 1 (DDI/DKI)
modldrv – linkage structure for loadable drivers#include <sys/modctl.h>Solaris DDI specific (Solaris DDI)The modldrv structure is used by device
modlinkage – module linkage structure#include <sys/modctl.h>Solaris DDI specific (Solaris DDI)The modlinkage structure is provided by the module
PrefaceBoth novice users and those familar with the SunOS operating system can use onlineman pages to obtain information about the system and its feat
modlstrmod – linkage structure for loadable STREAMS modules#include <sys/modctl.h>Solaris DDI specific (Solaris DDI)The modlstrmod structure is u
module_info – STREAMS driver identification and limit value structure#include <sys/stream.h>Architecture independent level 1 (DDI/DKI).When a mod
msgb – STREAMS message block structure#include <sys/stream.h>Architecture independent level 1 (DDI/DKI)A STREAMS message is made up of one or mo
no-involuntary-power-cycles – device property to prevent involuntary power cyclesA device that might be damaged by power cycles should export the bool
ATTRIBUTE TYPE ATTRIBUTE VALUEInterface stability Evolvingattributes(5), pm(7D), attach(9E), detach(9E), ddi_prop_create(9F)Writing Device Driversno-i
pm – Power Management propertiesThe pm-hardware-state property can be used to influence the behavior of thePower Management framework. Its syntax and i
ATTRIBUTE TYPE ATTRIBUTE VALUEInterface stability Evolvingpower.conf(4), pm(7D), attach(9E), detach(9E), pm_busy_component(9F),pm_create_components(9F
pm-components – Power Management device propertyA device is power manageable if the power consumption of the device can be reducedwhen it is idle. In
names should be descriptive, such as "On," "Off," "Suspend," "Standby," etc. The nextcomponent continues the a
ATTRIBUTE TYPE ATTRIBUTE VALUEInterface stability Evolvingpower.conf(4), pm(7D), attach(9E), detach(9E),ddi_prop_update_string_array(9F) pm_busy_compo
Section 9 provides reference information needed to write device drivers in thekernel environment. It describes two device driver interface specificati
qband – STREAMS queue flow control information structure#include <sys/stream.h>Architecture independent level 1 (DDI/DKI)The qband structure cont
qinit – STREAMS queue processing procedures structure#include <sys/stream.h>Architecture independent level 1 (DDI/DKI)The qinit structure contai
queclass – a STREAMS macro that returns the queue message class definitions for agiven message block#include <sys/stream.h>queclass(mblk_t *bp);S
queue – STREAMS queue structure#include <sys/stream.h>Architecture independent level 1 (DDI/DKI)A STREAMS driver or module consists of two queue
removable-media – removable media device propertyA device that supports removable media—such as CDROM, JAZZ, and ZIPdrives—and that supports power man
scsi_address – SCSI address structure#include <sys/scsi/scsi.h>Solaris architecture specific (Solaris DDI)A scsi_address structure defines the add
scsi_arq_status – SCSI auto request sense structure#include <sys/scsi/scsi.h>Solaris DDI specific (Solaris DDI)When auto request sense has been e
scsi_asc_key_strings – SCSI ASC ASCQ to message structure#include <sys/scsi/scsi.h>Solaris DDI specific (Solaris DDI).The scsi_asc_key_strings st
scsi_device – SCSI device structure#include <sys/scsi/scsi.h>Solaris DDI specific (Solaris DDI).The scsi_device structure stores common informati
scsi_extended_sense – SCSI extended sense structure#include <sys/scsi/scsi.h>Solaris DDI specific (Solaris DDI).The scsi_extended_sense structure
PROTOCOL This section occurs only in subsection 3R toindicate the protocol description file.DESCRIPTION This section defines the functionality and behav
KEY_RECOVERABLE_ERRORIndicates that the last command completed successfully with some recovery actionperformed by the target.KEY_NOT_READYIndicates th
es_add_len indicates the number of additional sense bytes to follow.es_cmd_info contains information that depends on the command that was executed.es_
scsi_hba_tran – SCSI Host Bus Adapter (HBA) driver transport vector structure#include <sys/scsi/scsi.h>Solaris architecture specific (Solaris DDI
tran_start The function entry that starts a SCSI commandexecution on the HBA hardware.tran_reset The function entry that resets a SCSI bus or targetde
scsi_inquiry – SCSI inquiry structure#include <sys/scsi/scsi.h>Solaris DDI specific (Solaris DDI).The scsi_inquiry structure contains 36 required
DTYPE_COMM Communications device.DTYPE_UNKNOWN Unknown or no device type.DTYPE_MASK Mask to isolate Peripheral Device Type field.The following values a
inq_inq_len is the additional length field that specifies the length in bytes of theparameters.inq_reladdr, if set, indicates that the device supports t
scsi_pkt – SCSI packet structure#include <sys/scsi/scsi.h>Solaris DDI specific (Solaris DDI).A scsi_pkt structure defines the packet that is alloc
will call the function pointed to by this field and pass apointer to the packet as argument. The callback routineitself is called from interrupt contex
FLAG_NOINTRRun command with no command completion callback; command is complete uponreturn from scsi_transport(9F).FLAG_NODISCONRun command without di
Komentáře k této Příručce