Queues a message for transmission or blocks until the message can be queued.
#include <sys/device.h> #include <sys/comio.h>
int ddwrite (devno, uiop, chan, extptr) dev_t devno; struct uio *uiop; int chan; struct write_extension *extptr;
|devno||Specifies major and minor device numbers.|
|uiop||Points to a uio structure specifying the location and length of the caller's data.|
|chan||Specifies the channel number assigned by the device handler's ddmpx entry point.|
|extptr||Points to a write_extension structure. If the extptr parameter is null, then default values are assumed.|
The ddwrite entry point either queues a message for transmission or blocks until the message can be queued, depending upon the setting of the DNDELAY flag.
The ddwrite communications PDH entry point determines whether the data is in user or system space by looking at the uiop->uio_segflg field. If the data is in system space, then the uiop->uio_iov->iov_base field contains an mbuf pointer. The mbuf chain contains the data for transmission. The uiop->uio_resid field has a value of 4. If the data is in user space, the data is located in the same manner as for the ddwrite device driver entry point.
For this entry point, the extptr parameter can point to a write_extension structure. This structure is defined in the /usr/include/sys/comio.h file and contains the following fields:
|status|| Indicates the status of the port. This field may contain additional information about the completion of the ddwrite entry point. Besides the status codes listed here, device-dependent codes can be returned:
|flag|| Contains a bitwise OR of one or more of the following:
|writid||Contains the write ID to be returned in the CIO_TX_DONE status block. This field is ignored if the user did not request transmit acknowledgment by setting CIO_ACK_TX_DONE status block in the flag field.|
|netid||Contains the network ID.|
A ddwrite entry point can be called from the process environment only.
In general, communication device handlers use the common return codes defined for an entry point. However, device handlers for specific communication devices can return device-specific codes. The common return codes for the ddwrite entry point are the following:
|ENXIO||Indicates an attempt to use an unconfigured device.|
|EINVAL||Indicates a parameter that is not valid.|
|EAGAIN||Indicates the transmit queue is full and the DNDELAY flag is set. The command was not accepted.|
|EFAULT||Indicates a specified address is not valid.|
|EINTR||Indicates a blocking mode sleep was interrupted.|
|ENOMEM||Indicates the operation was unable to allocate the needed mbuf space.|
|ENOCONNECT||Indicates a connection was not established.|
|EBUSY||Indicates the maximum number of opens was exceeded.|
|ENODEV||Indicates the device does not exist.|
The CIO_GET_FASTWRT ddioctl Communications PDH Operation, CIO_GET_STAT ddioctl Communications PDH Operation, CIO_START ddioctl Communications PDH Operation.
The ddmpx entry point.
The uio structure.