| OpenSS7 SS7 for the Common Man | © Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved. Last modified: Sat, 01 Nov 2008 10:42:03 GMT | ||||||||||||||||
| |||||||||||||||||
| Manpage of MI_OPEN_COMMDescription: Manual PageKeywords: ss7 ss7/ip ss7 over ip ss7 mtp ss7 sccp ss7 tcap sigtran mtp sccp tcap openss7 acb56 linux telephony pstn linux telephony linux nebs linux compactpciMI_OPEN_COMMSection: OpenSS7 STREAMS Compatibility DDI/DKI (9)Updated: 2008-10-31 Index Return to Main Contents NAMEmi_open_comm, mi_open_comm_cache - STREAMS common minor device open utilitySYNOPSIS#define _MPS_SOURCE
ARGUMENTS
INTERFACEDESCRIPTIONmi_open_comm() and mi_open_comm_cache() perform housekeeping during STREAMS driver or module qi_qopen(9) operations. mi_open_comm() and mi_open_comm_cache() are intended to be called by the driver or module qi_qopen(9) procedure. They assign a minor device number to the stream (as specified by the sflag argument), allocate the requested per-stream data, and set the q_ptr fields of the stream being opened. Each call to mi_open_comm() must have a corresponding call to mi_close_comm(9). Each call to mi_open_comm_cache() must have a corresponding call to mi_close_comm_cache(9). RETURNWhen mi_open_comm() and mi_open_comm_cache() succeed, they return zero (0); when they fail, they return a non-zero error code. ERRORSWhen mi_open_comm() and mi_open_comm_cache() fail they return a non-zero error code as follows:
These error codes are selected so that they can be returned directly from qi_qopen(9). CONTEXTmi_open_comm() and mi_open_comm_cache() can be called from User Context. mi_open_comm() and mi_open_comm_cache() are normally called from within a STREAMS module's qi_qopen(9) procedure (User Context). MP-STREAMSmi_open_comm() and mi_open_comm_cache() are MP-safe. NOTICESmi_open_comm() and mi_open_comm_cache() are MPS®-specific functions: _MPS_SOURCE, _AIX_SOURCE or _MAC_SOURCE must be defined before including DDI/DKI include files to expose these symbols. OpenSS7 STREAMS Compatibility must also have been compiled with CONFIG_STREAMS_COMPAT_MPS, CONFIG_STREAMS_COMPAT_MPS_MODULE, CONFIG_STREAMS_COMPAT_AIX, CONFIG_STREAMS_COMPAT_AIX_MODULE, CONFIG_STREAMS_COMPAT_MAC or CONFIG_STREAMS_COMPAT_MAC_MODULE defined. IMPLEMENTATIONmi_open_comm() performs some sanity checks on the arguments that are passed to it, calls mi_open_alloc_sleep(9) to acquire the private structure and then calls mi_open_link(9) to link the private structure into the list and mi_attach(9) to attach the private structure to the q_ptr members of each queue in the queue pair. mi_open_comm_cache() performs some sanity checks on the arguments that are passed to it, calls mi_open_alloc_cache(9) to acquire the private structure and then calls mi_open_link(9) to link the private structure into the list and mi_attach(9) to attach the private structure to the q_ptr members of each queue in the queue pair. EXAMPLESFollowing is an example of a module qi_qopen(9) procedure using mi_open_comm():
static caddr_t xxx_state = NULL;
typedef struct {
dev_t my_dev;
queue_t *rq;
long some_data;
long some_more_data;
} xxx_priv_t;
int
xxx_open(queue_t *q, dev_t *devp, int oflag, int sflag,
cred_t *crp)
{
int err;
xxx_priv_t *priv;
err = mi_open_comm(&xxx_state, sizeof(xxx_priv_t),
q, devp, oflag, sflag, crp);
if (err != 0) {
return (err);
}
priv = q->q_ptr;
priv->my_dev = *devp;
priv->rq = q;
priv->some_data = SOME_DATA_INITIALIZER;
priv->some_more_data = SOME_MORE_DATA_INITIALIZER;
return (0);
}
SEE ALSOqi_qopen(9), mi_close_comm(9), mi_open_alloc_sleep(9), mi_open_alloc(9), mi_open_alloc_cache(9), mi_open_link(9), mi_attach(9), mi_next_ptr(9), ddi_soft_state_zalloc(9), mpscompat(9), aixcompat(9), maccompat(9), STREAMS(9). BUGSmi_open_comm() and mi_open_comm_cache() have no known bugs. COMPATIBILITYmi_open_comm() is compatible with MPS®, AIX®, MacOT®, and Solaris®, with the following portability considerations:
See mpscompat(9), aixcompat(9), maccompat(9), and STREAMS(9) for additional compatibility considerations. mi_open_comm_cache() is an OpenSS7 Project specific implementation of mi_open_comm() that is inherently non-portable. While it is fairly straightforward to implement these in any Mentat implementation present on modern day UNIX systems, it requires exposing internals to the MPS implementation that might not be desirable. CONFORMANCEMPS® DDI documentation, MacOT® DDI documentation[2, 3], AIX® documentation[4], The OpenSS7 Project. HISTORYmi_open_comm() first appeared in MPS®. mi_open_comm() is a Mentat, Inc. function that goes all the way back to the pre-OSF/1 Mentat implementations. mi_open_comm() appears in MacOT®[3] and AIX®[4]. An undocumented version of mi_open_comm() appears in Solaris®. mi_open_comm_cache() is an OpenSS7 Project function based loosely on the mi_open_comm() Mentat function. REFERENCES
TRADEMARKS
Other trademarks are the property of their respective owners. IDENTIFICATION
Copyright©1997-2008OpenSS7 Corp.
All Rights Reserved.
Index
This document was created by man2html, using the manual pages. Time: 14:24:54 GMT, May 23, 2013 | ||||||||||||||||
| OpenSS7 SS7 for the Common Man |
| ||||||||||||||||
| Last modified: Sat, 01 Nov 2008 10:42:03 GMT © Copyright 1997-2007 OpenSS7 Corporation All Rights Reserved. |