Performs housekeeping during STREAMS driver or module open operations.
The mi_open_comm subroutine performs housekeeping during STREAMS driver or module open operations. It is intended to be called by the driver or module open routine. It assigns a minor device number to the stream (as specified by the SFlag parameter), allocates the requested per-stream data, and sets the q_ptr fields of the stream being opened.
The mi_open_comm subroutine is part of STREAMS kernel extensions.
Item | Description |
---|---|
StaticPointer | Specifies the address of a static pointer which will be used internally by the mi_open_comm and related utilities to store the address of the module's list of open streams. This pointer should be initialized to NULL. |
Size | Specifies the amount of memory the module needs for its per-stream data. It is usually the size of the local structure which contains the module's instance data. |
Queue | Specifies the address of a queue_t structure. The q_ptr field of the of this structure, and of the corresponding read queue structure (if Queue points to a write queue) or write queue structure (if Queue points to a read queue), are filled in with the address of the queue_t structure being initialized. |
Device | Specifies the address of a dev_t structure. The use of this parameter depends on the value of the SFlag parameter. |
Flag | Unused. |
SFlag | Specifies how the Device parameter is to be used.
The SFlag parameter may take one of the following values:
|
credp | Unused |
On successful completion, the mi_open_comm subroutine returns a value of zero, otherwise one of the following codes is returned:
Code | Description |
---|---|
ENXIO | Indicates an invalid parameter. |
EAGAIN | Indicates that an internal structure could not be allocated, and that the call should be retried. |